Home Forums C Programming with out semicolon Reply To: with out semicolon

#3356
Humayan
Participant

I guess that depends on your definition of  “a program”. You could just do this:
 

void main()
{

}

 
This is a do nothing program. The lack of semicolons rules out most expressions and declarations , ect. You could add an empty loop:
 

 while ( 1 )
 {}
 
or
 while ( 0 )
 {}

 
Heres a copy of the C grammar that you can check out to maybe find more:
 
http://www.lysator.liu.se/c/ANSI-C-grammar-y.html