
15 Statements
15.7 Selection statements
15.7.1 The if statement
Paragraph 11 The if statement selects a statement for execution based on the value of a boolean expression. if-statement : if ( boolean-expression ) embedded-statement if ( boolean-expression ) embedded-statement else embedded-statement boolean-expression : expression
Paragraph 21 An else part is associated with the lexically nearest preceding if that is allowed by the syntax. [Example: Thus, an if statement of the form if (x) if (y) F(); else G();is equivalent to
if (x) {
if (y) {
F();
}
else {
G();
}
}
end example]
Paragraph 31 An if statement is executed as follows:
| |
| Jagger Software Ltd | |
| Company # 4070126 | |
| VAT # 762 5213 42 |