A conditional/decision-making construct evaluates a condition before the instruction/s are executed.
|Sr.No||Statement & Description|
An ‘if’ statement consists of a Boolean expression followed by one or more statements .
An ‘if’ statement can be followed by an optional ‘else’ statement, which executes when the Boolean expression is false.
|3||The else.. if ladder/nested if statements
The else…if ladder is useful to test multiple conditions. Following is the syntax of the same.
The switch statement evaluates an expression, matches the expression’s value to a case clause and executes the statements associated with that case.