CLASS EXERCISE
What is displayed after the following program is executed?
program AND_OR_NOT_DEMO (output);
var a, b, c : integer;
begin
a := 5; b := 3; c := 99;
if (a = 5) or (b > 2) then writeln('A');
if (a < 5) and (b > 2) then writeln('B');
if (a = 5) and (b = 2) then writeln('C');
if (c <> 6) or (b > 10) then writeln('D') else writeln('E');
if (b = 3) and (c = 99) then writeln('F');
if (a = 1) or (b = 2) then writeln('G');
if not( (a < 5) and (b > 2)) then writeln('H')
end.
Class Exercise .. Output of program AND_OR_NOT_DEMO is,
A
D
F
H
Copyright B Brown/P Henry/CIT, 1988-1997. All rights reserved.