How to Write a c program without using any semicolon which output is: Hello word.



In C language ';' is used as a line delimiter. It is specified that each line must be end with ';'. It is usefull for lexical analyser to detect the line end. But yes you can
write a C code without using ';' but you cant use full power of C langauge if you do this.


Solution: 1
void main(){ if(printf("Hello world")){ } }
Solution: 2
void main(){ while(!printf("Hello world")){ } }
Solution: 3
void main(){ switch(printf("Hello world")){ } }

No comments:

Post a Comment