pl0/tests/square.pl0

19 lines
240 B
Text
Raw Permalink Normal View History

2016-05-29 20:56:46 +02:00
# This program prints out squares
# Expect: 1 4 9 16 25 36 49 64 81 100
VAR x, squ;
PROCEDURE square;
BEGIN
squ := x * x
END;
BEGIN
x := 1;
WHILE x <= 10 DO
BEGIN
CALL square;
! squ;
x := x + 1
END
END.