The if Statement

Second form of the if statement:

   if (condition)
       then_statement
   else
      else_statement

The boolean_expression is evaluated. If it evaluates to true the then_statement is executed, otherwise the else_statement is executed.

Braces can be used to group multiple statements into a single then_statement or else_statement.

Index