prev

SELF TEST 21: 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, 1988-1999. All rights reserved.
prev