If Else Statement - StarShipTutor/StarshipTutorAPCS GitHub Wiki

The code block is executed if the () contains a statement that evaluates to the boolean 'true'. The statements can be chained with additional 'else' or 'else if' key words.

   int n;
   ...
   if (n == 1) 
   {
       // Execute this code block and jump to End
   }
   else if (n == 2)
   {
       // Execute this code block and jump to End
   }
   else
   {
       // If all else fails, execute this code block 

   }; // End if statement