An if statement lets you conditionally process a statement when the specified test expression evaluates to a nonzero value. The expression must evaluate to a scalar type. You can optionally specify an else clause on the if statement. If the test expression evaluates to 0 and an else clause exists, the statement associated with the else clause runs. If the test expression evaluates to a nonzero value, the statement following the expression runs and the else clause is ignored.
When if statements are nested and else clauses are present, a given else is associated with the closest preceding if statement within the same block.