cwtests/cw05/sqr.fun
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 30 Sep 2022 06:03:46 +0100 (2022-09-30)
changeset 879 ad9d4a01e072
parent 856 23273e3a120f
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)) ; new_line(); all(n + 1) }
  else skip()
};

all(0)