Lets write a c program to print the message without using semicolon. We can easily write the message by using printf("Hello World!"); in the main() function in c. But there we use the the semicolon to print this statement at the end of the line. For avoid the semicolon follow the some tricks.
// Using While loop
#include<stdio.h>
void main(){
while(!printf("Hello World!")){}
}
// Using Switch Statement
#include<stdio.h>
void main(){
switch(printf("Hello World!")){}
}
// Using if statement
#include<stdio.h>
void main(){
if(printf("Hello World!")){}
}
Comments
Oops!