Write down about the decision making statement if.






The if statement : The if statement is a powerful decision making statement and is used to control the flow of execution of statements. It is basically a two way decision-statement. It takes the following form,




                        if(test expression)

This point of program has two paths to follow, one for the true condition and the other for the false condition. That is shown in the following figure,


The if statement may be used in different forms depending on the complexity of conditions to be tested. The different forms are,


  1.  Simple if statement
  2. if....else statement
  3. Nested if......else statement
  4. else if ladder

Recommended Recommends

Comments

Contact Us

Loading...