Jump to content

Factorial: Difference between revisions

(→‎{{header|ALGOL 60}}: Section added)
Line 428:
return result;
}</lang>
 
=={{header|ALGOL 60}}==
{{works with|A60}}
<lang algol60>begin
comment factorial - algol 60;
integer procedure factorial(n); integer n;
begin
integer i,fact;
fact:=1;
for i:=2 step 1 until n do
fact:=fact*i;
factorial:=fact
end;
integer i;
for i:=1 step 1 until 10 do outinteger(1,factorial(i));
outstring(1,"\n")
end</lang>
{{out}}
<pre>
1 2 6 24 120 720 5040 40320 362880 3628800
</pre>
 
=={{header|ALGOL 68}}==
1,392

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.