aboutsummaryrefslogtreecommitdiff
path: root/example/example.imp
blob: a5bc5dd3e9c609a890dd728d770764772a580565 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
procedure factorial(n;r) begin
  if n <= 0 then
    r := 1;
  else
    m := n - 1;
    factorial(m;r);
    r := r * n;
  end;
end;

n := 5;
factorial(n;r);