if statement conditionally executes another statement based on whether a specified condition is true. There are two forms of the
if: one with an
else branch and one without. The syntactic form of the simple
if (condition) statement
if else statement has the form
if (condition) statementelse statement2
In both versions, condition must be enclosed in parentheses. condition can be an expression or an initialized variable declaration (§ 5.2, p. 174). The expression or variable must have a type that is convertible (§ 4.11, p. 159) to
bool. As usual, either or both statement and statement2 can be a block. ...