Mega Code Archive

 
Categories / C Tutorial / Statement
 

If with else statement

The general format for an if-else statement is if (condition)    simple or compound statement   else    simple or compound statement. #include <stdio.h> main(){   int i = 5;   if(i > 0){      printf(" i > 0. \n");   }else{      printf(" i < 0. \n");   } } i 0.