How to print a semicolon(;) without using semicolon in C/C++?
Another interesting question is how can a semicolon be printed without using any semicolon in the program. Here are methods to print “;” :
- Using printf / putchar in if statement:
- We can also print the semicolon using switch/ while / for as illustrated in this article.
- Using macros :
3. Using std::cout
Related article: Print Hello World without semicolon in C/C++ If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.