Whats wrong in this code could u tell i am not able to solve the question

similar question is asked by you previously
i have just now reply to that also
you also have to do that changes here

  1. use long long int instead of int
  2. data type of p array should be bool not int as you are storing 0 and 1 only
  3. The 500000th prime is 7368787
    roughly 74*10^5

do all these changes and then try

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.