Perfect numbers: Difference between revisions
Content added Content deleted
Basicgames (talk | contribs) |
|||
Line 1,016: | Line 1,016: | ||
</syntaxhighlight> |
</syntaxhighlight> |
||
==={{header|Craft Basic}}=== |
|||
<syntaxhighlight lang="basic">print "calculating..." |
|||
for n = 1 to 10000 |
|||
let s = 0 |
|||
for i = 1 to n / 2 |
|||
if n % i = 0 then |
|||
let s = s + i |
|||
endif |
|||
next i |
|||
if s = n then |
|||
print n, " is perfect." |
|||
endif |
|||
wait |
|||
next n</syntaxhighlight> |
|||
==={{header|IS-BASIC}}=== |
==={{header|IS-BASIC}}=== |