Is it possible to write a c program without semicolons?

Questions by kamba

Showing Answers 1 - 33 of 33 Answers

Yes, It is possible.

Example:

#include<stdio.h>
main(){

          if(0){
          }else{

         

         }


 }



  Was this answer useful?  Yes

jintojos

  • May 23rd, 2008
 


      // Program For Finding Squar Of A NUmber
#define Squar(x) (x*x)
void main()
  {
         while(!printf("Squar Of 2 Is %d",Squar(2))){}
  }

Addition of 2 no without using semicolon:

void main(){  while( !printf("sum value=%d",10+20) ) { }  }

or,

void main(){  if( printf("sum value=%d",10+20) ) { }  }

or,

void main(){  switch( printf("sum value=%d",10+20) ) { }  }

Manali

  • Sep 18th, 2011
 

Code
  1. #include<stdio.h><br /><br />void main()<br /><br /> {<br /><br />   if(printf("no semicolon"))<br /><br /> {}<br /><br /> }

  Was this answer useful?  Yes

prasanna

  • Dec 4th, 2013
 

max and min program without semicolon

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions