The if statement

If statements are often combined like this:

   if (condition1) {
      statements1;
   }
   else if (condition2) {
      statements2;
   }
   ...
   else if (conditionn-1) {
      statementsn-1;
   }
   else {
      statementsn;
   }
Evaluates conditions until finds a True one;

then executes corresponding statements;

then finishes if statement.

Index