Factorial: Difference between revisions
m
→{{header|Craft Basic}}
mNo edit summary |
Basicgames (talk | contribs) |
||
Line 1,493:
==={{header|Craft Basic}}===
<syntaxhighlight lang="basic">'
print "version 1 without function"
let f = 1▼
for i = 1 to 12
alert "factorial"▼
let n = i
do▼
▲ let f = 1
▲ do
let f = f * n▼
let n = n - 1▼
loop n > 0▼
▲ loop n > 0
print f▼
▲ print f, " ",
end</syntaxhighlight>▼
wait
next i
print newline, newline, "version 2 with function"
for i = 1 to 12
{{out| Output}}<pre>version 1 without function
1 2 6 24 120 720 5040 40320 362880 3628800 39916800 479001600
version 2 with function
1 2 6 24 120 720 5040 40320 362880 3628800 39916800 479001600 </pre>
==={{header|FreeBASIC}}===
|