if- else important example

C Programming Language Decision Making of C Language (Article) Decision Making of C Language (Program)

28261

Program:

#include"stdio.h"
int main () {

   /* local variable definition */
   int a = 100;
 
   /* check the boolean condition */
   if( a < 20 ) {
      /* if condition is true then print the following */
      printf("a is less than 20\n" );
   }
   else {
      /* if condition is false then print the following */
      printf("a is not less than 20\n" );
   }
   
   printf("value of a is : %d\n", a);
 
   return 0;
}

Output:

a is not less than 20
value of a is : 100
Press any key to continue . . .

This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.