Why C has a compound IF statement
Consider the following pair of of double-if statements, with the first IF being done if the control_expression is TRUE, and the second one being done if the expression is FALSE (NOT TRUE):
IF control_expression
A first set of one or more statements
ENDIF
IF ! control_expression
A second set of one or more statements
ENDIF
This pairing happens often enough that C allows the above two IF statements to be written as one IF/ELSE statement:
IF control_expression
A first set of one or more statements
ELSE
A second set of one or more statements
ENDIF
The meaning is identical in both cases. The IF/ELSE version is more efficient, since it only has to test the condition once. If the condition is TRUE, the first set of statements is executed. If the condition is FALSE, the second set is executed instead.