oberonbyexample/examples/procedures/function-procedure/Square.Mod
Antranig Vartanian 95b512baf4
post rebranding
2024-05-11 19:17:23 +04:00

20 lines
231 B
Modula-2

MODULE square;
IMPORT Out;
VAR s : INTEGER;
PROCEDURE squared(x : INTEGER): INTEGER;
BEGIN
RETURN x * x
END squared;
BEGIN
s := squared(7);
Out.Int(s, 0); Out.Ln;
Out.Int(squared(8), 0); Out.Ln;
END square.