Else if Ladder Statement
IF ELSE IF Ladder
The if-else-if ladder statement executes one condition from multiple statements. The execution starts from top and checked for each if condition. The statement of if block will be executed which evaluates to be true. If none of the if condition evaluates to be true then the last else block is evaluated.
Syntax:
if(condition_expression_One) { statement1; } else if (condition_expression_Two) { statement2; } else if (condition_expression_Three) { statement3; } else { statement4; }