home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 2
/
FFMCD02.bin
/
new
/
dev
/
misc
/
p2c
/
examples
/
fact.p
< prev
next >
Wrap
Text File
|
1993-12-21
|
299b
|
28 lines
program factorials(input, output);
var
i : integer;
function fact(n : integer) : integer;
begin
if n > 1 then
fact := n * fact(n-1)
else
fact := 1;
end;
begin
for i := 1 to 10 do
writeln('The factorial of ', i:1, ' is ', fact(i):1);
end.