C Program To Print Hello World Without Semicolon
Learn How To Print Hello World without Semicolon in C Programming Language. It is probably the very first C Program that every programmer begins with. This code demonstrates the legacy approach towards printing Hello World C Program in a new way.
A general Hello World C Program includes a printf(); statement within the main function with a terminating Semicolon.
1 2 3 4 5 6 7 | #include<stdio.h> int main() { printf("Hello World\n"); return 0; } |
The above code is just an example of the usual way of writing a Hello World Program. Now, let us see the new approach of writing it without using a semicolon at the end of the printf() statement. We have used a while loop within the main method. In a While Loop, you need not use a Semicolon to terminate the printf() statement.
Method 1: C Program To Print Hello World Without Semicolon using While Loop
1 2 3 4 5 6 7 8 9 | #include<stdio.h> void main() { while(!printf("Hello World\n")) { } } |
Method 2: Display Hello World without using Semicolon in C Programming using Switch Case
1 2 3 4 5 6 7 8 9 | #include<stdio.h> void main() { switch(printf("Hello World")) { } } |
Method 3: C Code for Hello World without using Semicolon using If Block
1 2 3 4 5 6 7 8 9 | #include<stdio.h> void main() { if(printf("Hello World")) { } } |
Output

In case you have any compilation errors or doubts in this C Program To Print Hello World without Semicolon, let us know about it in the comment section below.
Thanks for providing it.. tushar bro
Your Welcome Indrajeet! 🙂
Can we also use for loop and do while loop in this Hello World code?
Yes, you can definitely use other looping constructs. However, you need to know how to work with the semicolons within a for loop if you want to implement it in here.