SELF TEST ON LOCAL VARIABLES
Determine this programs output.
program MUSIC (output);
const SCALE = 'The note is ';
var JohnnyOneNote : char;
procedure Tune;
const SCALE = 'The note now is ';
var JohnnyOneNote : char;
begin
JohnnyOneNote := 'A';
writeln(SCALE, JohnnyOneNote )
end;
begin
JohnnyOneNote := 'D';
writeln(SCALE, JohnnyOneNote );
Tune;
writeln(SCALE, JohnnyOneNote )
end.
Self Test on Local variables, output of program MUSIC is,
The note is D
The note now is A
The note is D
Copyright B Brown/P Henry/CIT, 1988-1997. All rights reserved.