Executing more than one statement as part of an IF
To execute more than one program statement when an if
statement is true, the program statements are grouped using the
begin and end keywords. Whether a semi-colon follows
the end keyword depends upon what comes after it. When
followed by another end or end. then it no semi-colon, eg,
program IF_GROUP1 (input, output); var number, guess : integer; begin number := 2; writeln('Guess a number between 1 and 10'); readln( guess ); if number = guess then begin writeln('Lucky you. It was the correct answer.'); writeln('You are just too smart.') end; if number <> guess then writeln('Sorry, you guessed wrong.') end. program IF_GROUP2 (input, output); var number, guess : integer; begin number := 2; writeln('Guess a number between 1 and 10'); readln( guess ); if number = guess then begin writeln('Lucky you. It was the correct answer.'); writeln('You are just too smart.') end end.