progs/fact.rec
author cu
Sun, 15 Oct 2017 20:47:14 +0100
changeset 519 955d5b3b0619
parent 224 70198792c2aa
permissions -rw-r--r--
updated

def fact(n) = if n == 0 then 1 else n * fact(n - 1);

def facT(n, acc) = if n == 0 then acc else facT(n - 1, n * acc);

facT(15, 1)

//fact(15)