Deepak and primes

why my solution doesnt work.

https://ide.geeksforgeeks.org/DLWHBG1F9l

@perul1999
It is mentioned in the problem that n can be as large as 5000000. That is , we may have to print 5000000th prime number in worst case. This value is a little over 87 million. Your sieve array is very small compared to that.

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.