progs/fun2/sqr.fun
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 03 Sep 2021 23:53:31 +0100
changeset 831 d499da29894c
parent 820 7fd1f611c21d
child 854 ce4a7bab6bd8
permissions -rw-r--r--
updated

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)