Prime sieve eratosthenes

sir I do not understand the for loop in sieve
for(j=i*i, j<1000000, j+=i)
how does it work?

Hello @mzk1994 in this if the number is prime like 3 then we will mark its multiples starting from its square as 0.

It will start from 9 and go on as 9,12,15,18,21,24 all as 0

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.