Page 45 - 6437
P. 45

Example


                 #include <stdio.h>


                 int main ()

                 {
                    /* local variable definition */
                    int a = 10;


                    /* check the boolean condition using if statement */

                    if( a < 20 )
                    {

                         /* if condition is true then print the following */
                         printf("a is less than 20\n" );

                    }
                    printf("value of a is : %d\n", a);


                    return 0;

                 }
                          When the above code is compiled and executed, it produces the following result:


                 a is less than 20;




                                                                                                      47
   40   41   42   43   44   45   46   47   48   49   50