comparison lab3/fac.p @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:bfdcc3820b32
1 (* lab3/fac.p *)
2
3 proc fac(i);
4 begin
5 if i = 0 then
6 return 1
7 else
8 return i * fac(i-1)
9 end
10 end;
11
12 begin
13 print fac(10); newline
14 end.
15
16 (*<<
17 3628800
18 >>*)