But it is in the initial assignment part (evaluated once), and not the condition or step parts (which are evaluated every time).
Type: Posts; User: Salem
But it is in the initial assignment part (evaluated once), and not the condition or step parts (which are evaluated every time).
> for (i = 3, r = sqrt(number) ; i <= r && prime ; i += 2)
Watch this
https://en.wikipedia.org/wiki/File:Sieve_of_Eratosthenes_animation.gif
What you should have for i+=2 is something...