Jump to content

Perfect numbers: Difference between revisions

Line 1,016:
</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}}===
305

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.