mirror of
https://github.com/vishapoberon/oberonbyexample.git
synced 2026-04-06 05:12:25 +00:00
post rebranding
This commit is contained in:
parent
4169aecd5b
commit
95b512baf4
66 changed files with 716 additions and 15 deletions
20
examples/procedures/function-procedure/Square.Mod.ob2
Normal file
20
examples/procedures/function-procedure/Square.Mod.ob2
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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.
|
||||
Loading…
Add table
Add a link
Reference in a new issue