content_image/826540.jpg
## 4.C. The Compound Statement and the Empty Statement 

The compound statement specifies that its component statements be executed in the same sequence as they are written. The symbols begin and end act as statement brackets. Note that the statement part or "body" of a program has the form of a compound statement. (See Figures 3.a - 3.c.) 

<img src='content_image/826540.jpg'>

program BeginEndExample(Output); { Program 4.1 - Illustrate the compound statement. } var Sum: Integer; begin Sum := 3 + 5; Writeln(Output, Sum, -Sum) end . 

Produces as results: 

8 -8 

Pascal uses the semicolon to separate statements, not to terminate statements; i.e., the semicolon is not part of the statement. The explicit rules regarding semicolons are reflected in the syntax of Appendix D. If one had written a semicolon after the second statement in Program 4.1, then an empty statement (implying no action) would have been assumed between the semicolon and the symbol end. This does no harm, for an empty statement is allowable at this point. Misplaced semicolons can, however, cause troubles - note the example for if statements in Section 4.E. 

