Multifactorial: Difference between revisions

Add CLU
(Add CLU)
Line 502:
4 (1 2 3 4 5 12 21 32 45 120)
5 (1 2 3 4 5 6 14 24 36 50)</pre>
 
=={{header|CLU}}==
<lang clu>multifactorial = proc (n, degree: int) returns (int)
result: int := 1
for i: int in int$from_to_by(n, 1, -degree) do
result := result * i
end
return (result)
end multifactorial
 
start_up = proc ()
po: stream := stream$primary_output()
for n: int in int$from_to(1, 10) do
for d: int in int$from_to(1, 5) do
stream$putright(po, int$unparse(multifactorial(n,d)), 10)
end
stream$putc(po, '\n')
end
end start_up</lang>
{{out}}
<pre> 1 1 1 1 1
2 2 2 2 2
6 3 3 3 3
24 8 4 4 4
120 15 10 5 5
720 48 18 12 6
5040 105 28 21 14
40320 384 80 32 24
362880 945 162 45 36
3628800 3840 280 120 50</pre>
 
=={{header|Common Lisp}}==
2,114

edits