home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
379a.lha
/
p2c1_13a
/
src
/
src.zoo
/
fact.p
< prev
next >
Wrap
Text File
|
1990-03-17
|
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.