Prime sieve video by prateek bhaiya

i am not able to understand the sieve code that is done by prateek bhaiya. please make me understand the code much batter.

@Abhishmu5
Can you please tell me what is the thing that you are not getting?

sir, uder sieve code sir made a comment that //if current no. is not marked. then how he can use if(p[i]==1).

p[i]==1 means the number is prime, then all the multiples of i would be composite numbers ( not primes).

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.