Showing posts with label if-else statement. Show all posts
Showing posts with label if-else statement. Show all posts

January 21, 2013

Decision making- Nested If else


decision making banner of nested if else statement

This statement can be used to select any one statement or a block which contains a set of instructions. Only that statement will execute which is true according to the data entered and rest other conditions will not executed.

FORMAT:
if(expression1)
Statement1;
else if(expression2)
statement2;
else if(expression3)
statement3;

Decision making- If else statement

decision making banner in if-else statement


This statement is also a conditional statement. It starts with keyword ‘if’ followed by an expression followed by “ first statement”  and “ second statement” is given after ‘else’ clause.

Format:
if(expression)
statement1;
else
statement2;