Short Note on 'Else if ladder' in C
Else If Ladder :- Else if statement can be defined as a control statement which controls the statement(s) to be executed on the basic of some conditions. Whenever the else if statement is used the compile initially checks the condition whether it is true or false and if the condition is true then the corresponding statements are executed. If the condition is false, it continues checking the next else if statement util the condition comes to be true or the control comes to the end of the else if ladder.
The syntax of else if ladder can be represented as -
if (condition 1)
statement 1;
else if (condition 2)
statement 2;
..............
..............
..............
..............
else if (condition n)
statement n;
else
default statement;
flowchart of the if else ladder statement
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment