An if or if else statement within another if or if else statement is called “nested if statement” when an action has to be performed based on many decisions involving various types of expressions and variables then this statement is used so it is called multi way decision statement.
if the cond1 is evaluated to true, the next inner if statement is executed. The cond2 is checked for true or false.
if it is evaluated to true, then the statement in block C are executed otherwise, the statements in BlockD are executed.If above cond1 is not true then statement in Block E is executed.
Q.) W.A.P to print the greater number using simple if-else statement.
int a , b, c;
printf(“enter three number”);
printf(“Max = %d”,c);
enter three numbers:3 4 5