1: program recursion(input, output);
   2: var i : integer;
   3: 
   4: function fact(n : integer) : integer;
   5: begin
   6:     if n <= 1 then begin
   7:         fact := 1;
   8:     end else begin
   9:         fact := n * fact(n-1);
  10:     end;
  11: end;
  12: 
  13: begin
  14:     i := 3;
  15:     writeln(i:1, '! = ', fact(i):1);
  16: end.
Last modified: 1984-04-01
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1467
Valid CSS Valid XHTML 1.0 Strict