In this tutorial you will learn about the C Program to Print Without Semicolon and its application with practical example.
C Program to Print Without Semicolon
In this tutorial, we will learn to create a C program that will Print Without semicolons in C programming.
Prerequisites
Before starting with this tutorial we assume that you are best aware of the following C programming topics:
- Operators in C Programming.
- Basic Input and Output function in C Programming.
- Basic C programming.
- Concepts of for loop.
- Using while statement of C language.
- Using Switch in C programming.
Print a Semicolon Without Semicolon.
In the C programming language, a semicolon is used to complete any string or statement. but in today’s tutorial, we will learn to create a program that will print a statement without using semicolons. The semicolons are used to end or complete any function.
There are three methods by which we can do this.
- Using conditional statements.
- With the help of a switch case.
- By using looping statements.
With the help of this program, we can Print Without a Semicolon.
Algorithm 1:-
1 2 3 4 5 6 7 |
1. Include the header files 2. Define a conditional if statement 3. Print using method. 4. End |
Method 2 Algorithm:-
1 2 3 4 5 6 7 |
1. Include the header files 2. Define a switch statement 3. Print using method. 4. End |
Method 3 Algorithm:-
1 2 3 4 5 6 7 |
1. Include the header files 2. Define a while statement 3. Print using method. 4. End |
Program to Print Without a Semicolon:-
Method type 1 to print a semicolon with the help of conditional statement if.
1 2 3 4 5 6 7 8 9 10 |
#include<stdio.h> int main() { // Printing with the help of conditional statements if(printf("W3Adda")) { } return 0; } |
Method type 2 to print a semicolon with the help of a switch.
1 2 3 4 5 6 7 8 9 10 |
#include<stdio.h> int main() { // Printing with the help of Switch statements switch(printf("W3Adda!!!")) { } return 0; } |
Program type 3 to print a semicolon with the help of a while.
1 2 3 4 5 6 7 8 9 |
#include<stdio.h> int main() { // Printing with the help of While statements while(!printf("Welcome to W3adda")) { } return 0; } |
Output:-
Printing without the semicolon 1.
Method 2 for printing the semicolon on the output console.
Method 3 for printing the semicolon on the output console.
Code for program 1
Program 2 Code
Code For Program 3