Quote:
Originally posted by moonwalker
here's the modified code..
concentrate on the bold lines...
[edited out]
you might also want to optimize your code... for example, the loop
needn't go from count = 2 to count < number...
if you have 7 ... for example, the loop can go till 7/2 (integer
division) ... which is 3 ....
if you cross 3, there won't be any factors anyways...
this will save a lot of ****work when you're checking for huuge
numbers like 100000001 ... it only needs to check till half of that
number to see if it's prime or not..
i think you can check all numbers up to the square root of the number and still be on the safe side