The Concept of Action  43  4.E.  Conditional Statements  4.E.l  The if statement  A  conditional statement  selects a single statement of its component  statements for execution.  Pascal  offers  two  kinds  of conditional  statements, the if and case statements.  The  if  statement  specifies that a statement be executed only if a certain  condition (Boolean expression) is true.  If  it is false, then either no  statement or the statement following the symbol  else is executed.  The form of an if statement is:  if P  then begin Sl;  S2;  S3 end;  else S4  is incorrect. More deceptive is the text:  if P  then;  begin Sl;  S2;  S3  end  Here, the statement controlled by the  if  is  the empty statement  between the  then and the semicolon; hence, the compound statement  following the if statement will always be executed.  The syntactic ambiguity arising from the construction:  if expression1 then if expression2 then statement1  else statement2  is resolved by interpreting this construction as equivalent to  The expression between the symbols  if and then must be oftype  Boolean. Note that the first form may be regarded as an abbreviation of  the second when the alternative statement is the empty statement.  Caution: there is never a semicolon before an  else! Hence, the text:  Figure 4.m  Syntax diagram for  IjStatement  Statement  ~...::>- ... 