In this post, we will learn how to print hello world without using semicolon in C Programming language.
There are various approaches to writing this program. Some of them are as follows:
- Using If Statement
- Using While Statement
- Using If-else Statement
- Using Switch Case
So, without further ado, let’s begin this tutorial.
C Program To Print Hello World Without Using Semicolon Using If Statement
// C Program To Print Hello World Without Using Semicolon #include <stdio.h> int main(){ if (printf("Hello, World")){ } return 0; }
Output
Hello, World
C Program To Print Hello World Without Using Semicolon Using While Statement
// C Program To Print Hello World Without Using Semicolon #include <stdio.h> int main(){ while(printf("Hello, World!")){ break; } return 0; }
Output
Hello, World!
C Program To Print Hello World Without Using Semicolon Using If-else Statement
// C Program To Print Hello World Without Using Semicolon #include <stdio.h> int main(){ if(0){ } else if (printf("Hello, World!")){ } return 0; }
Output
Hello, World!
C Program To Print Hello World Without Using Semicolon Using Switch case
// C Program To Print Hello World Without Using Semicolon #include <stdio.h> int main(){ switch(printf("Hello, World!")){ } return 0; }
Output
Hello, World!
Conclusion
I hope after going through this post, you understand how to print hello world without using a semicolon in C Programming language.
If you have any doubt regarding the program, feel free to contact us in the comment section. We will be delighted to help you.
Also Read: