About if statement

About if statement:


Syntax
1. if(condition)
       statement;

2. if(condition)
      {
        statements
       }

3. if(condition)
       statement;
    else
        statement;

4. if(condition)
       statement;
    else if(condition
        statement;
    |
    |
    |
    else
         statement;


Above are 4 methods of writing if statement to handle simple and complex condition.

Comments