
First, our if statement tests to see if the variable is equivalent to 1. If it is, it executes the lines of
code enclosed in the braces and terminates the statement (that is, no code in the else clauses of this
statement will be executed). If it isn’t, it looks to see if there is an else clause, and there is.The first else
condition says to run another test: Is the variable equivalent to 2? If it is, we enter that block of code
(notice that there are no braces around that next section of code; this is permissible as long as there is
only one semicolon-terminated statement in the block) and don’t execute any other else clauses in this
if statement. ...