Factorial: Difference between revisions
Content added Content deleted
mNo edit summary |
Basicgames (talk | contribs) |
||
Line 1,493: | Line 1,493: | ||
==={{header|Craft Basic}}=== |
==={{header|Craft Basic}}=== |
||
<syntaxhighlight lang="basic">' |
<syntaxhighlight lang="basic">'accurate between 1-12 |
||
'accurate between 1-12 |
|||
print "version 1 without function" |
|||
⚫ | |||
for i = 1 to 12 |
|||
⚫ | |||
input "enter an integer: ", n |
|||
let n = i |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
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}}=== |
==={{header|FreeBASIC}}=== |