[an error occurred while processing this directive]

The if statement

Syntax

     if ( condition ) 
     {
         statement(s)
     }
 

     if ( condition )
     {
         statement(s)
     } 
     else 
     {
         statement(s)
     }

Examples

     if (n > 0) 
     {
         printf("positive\n");
     }


     if (n > 0) 
     {
         printf("positive\n"); 
     }
     else 
     {
         printf("negative\n"); 
     }


     if ( n > 0) {
         printf("positive\n");
     } else {
         printf("negative\n"); 
     }
[an error occurred while processing this directive]
Sunday, 16-Feb-1997 13:26:52 EST