mirror of
https://github.com/vishapoberon/oberonbyexample.git
synced 2026-04-05 21:02:25 +00:00
20 lines
231 B
Text
20 lines
231 B
Text
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.
|