How to Print String Without Using Semicolon in C Language
Compiled on Jul 31 2012 in C
Yes, we can print string without using semicolon (;) (terminator) in whole program of C language. In this tutorial I will tell you how to print string without using any semicolon in C Language.
Here are few programs you can try them:
Here the {} act as a blank compound statement. But it is not mandatory to put some simple statements in it which require a semicolon. There are many more such answers to this question but the basic funda will be sameProgram 1:
#include
void main() {
if(printf("👋")) {
}
}
Program 2:
#include
int main()
{
while(printf("Times of Computer")&&0)
{}
}
Program 3:
#include
void main()
{
while(printf("Times of Computer")?0:1)
{}
}
Program 4:
#include
void main()
{
if(printf("Times of Computer")!=0)
{}
}
Code given below, can be used as a screen stopper.
#include //Add it in the beginning of the program
if(getch()) //Add just before main where block closes