progs/fact.rec
changeset 626 2d91b2107656
parent 625 6709fa87410b
child 627 f5214da1976e
equal deleted inserted replaced
625:6709fa87410b 626:2d91b2107656
     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