Compile-time calculation: Difference between revisions

Compile-time calculation in Run BASIC
(Compile-time calculation in BASIC256)
(Compile-time calculation in Run BASIC)
Line 1,397:
func factorial nr if nr = 1 return 1 else return nr * factorial(nr-1) ok
</syntaxhighlight>
 
=={{header|Run BASIC}}==
{{works with|Just BASIC}}
{{works with|Liberty BASIC}}
<syntaxhighlight lang="vb">factorial = 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10
print "10! = "; factorial ' 3628800</syntaxhighlight>
 
=={{header|Rust}}==
2,148

edits