The if-else-if Ladder
In a general programming construct which is based upon a sequence of nested ifs is the if else if ladder. It seems like this:
if(condition)
statement;
else if (condition)
statement;
else if (condition);
statement;
.
.
. else.
statement.
That if statements are executed from the top down. Since soon as one of the conditions controlling the if is true, a statement related along with that if is executed, the rest statements of the ladder are bypassed. The last else statement will be executed if none of the conditions is true. The last else acts as a default condition; which is if all other conditional tests fail, rather than the last else statement is performed. No action will take place if there is not final else and all other conditions are false.