Syntax:
if ( boolean_expression ) true_block else false_block
if (
)
else
Purpose:
executes false_block if the boolean_expression of the if statement is false. This command is only valid in combination with an if command.
if
Example:
int i=3; if (i > 5) { "i is bigger than 5"; } else { "i is smaller than 6"; } → i is smaller than 6
See Control structures; boolean expressions; if.