1(* 2 * Copyright (c) 1980, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)recur.p 8.1 (Berkeley) 06/06/93 8 *) 9 10program recursion(input, output); 11var i : integer; 12 13function fact(n : integer) : integer; 14begin 15 if n <= 1 then begin 16 fact := 1; 17 end else begin 18 fact := n * fact(n-1); 19 end; 20end; 21 22begin 23 i := 3; 24 writeln(i:1, '! = ', fact(i):1); 25end. 26