September 1998
Intermediate to advanced
848 pages
20h 13m
English
The keywords for if statements are if and else.
In each of the following forms, the statement can be either a simple statement or a compound statement. A "true" expression, more generally, means one with a nonzero value.
if (expression) statement
The statement is executed if the expression is true.
if (expression) statement1 else statement2
If the expression is true, statement1 is executed. Otherwise, statement2 is executed.
if (expression1) statement1 else if (expression2) statement2 else statement3
If expression1 is true, statement1 is executed. If expression1 is false but expression2 is true, statement2 is executed. Otherwise, if both expressions ...
Read now
Unlock full access