You need brackets around what you want in the for-loop. No brackets means that only the next instruction is part of the loop. Put brackets around what needs to be repeated:
You need brackets around what you want in the for-loop. No brackets means that only the next instruction is part of the loop. Put brackets around what needs to be repeated:
if number is odd
for i = 2 to number
if number divisible by i
haveFactors = true;
break;
end if
end for
if haveFactors is false, we have a prime number.
end if
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.