changeset 820 | 7fd1f611c21d |
child 854 | ce4a7bab6bd8 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/progs/fun2/sqr.fun Sat Dec 19 00:13:58 2020 +0000 @@ -0,0 +1,12 @@ +val Max : Int = 10; + +def sqr(x: Int) : Int = x * x; + +def all(n: Int) : Void = { + if n <= Max + then print_int(sqr(n)) ; all(n + 1) + else skip() +}; + +all(0) + \ No newline at end of file