Jump to content

Factorial: Difference between revisions

→‎{{header|APL}}: Recursive definition
imported>MaD70
(→‎{{header|APL}}: Recursive definition)
Line 750:
<syntaxhighlight lang="apl"> FACTORIAL 6
720</syntaxhighlight>
{{works with|Dyalog APL}}
A recursive definition is also possible:
<syntaxhighlight lang="apl">
fac←{⍵>1 : ⍵×fac ⍵-1 ⋄ 1}
fac 5
120
</syntaxhighlight>
 
=={{header|AppleScript}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.