progs/fact.rec
changeset 224 70198792c2aa
equal deleted inserted replaced
223:e4b29b57f6a3 224:70198792c2aa
       
     1 def fact(n) = if n == 0 then 1 else n * fact(n - 1);
       
     2 
       
     3 def facT(n, acc) = if n == 0 then acc else facT(n - 1, n * acc);
       
     4 
       
     5 facT(15, 1)
       
     6 
       
     7 //fact(15)
       
     8