Not able to pass one of the testcases

This is the code, please help me to improve it

Hey @prerna_gupta31
Please follow this :Deepak and primes

I am still not able to understand, it does not match with my code

Hey basically u have to tell nth prime number where for n=500000 ,the prime number
will be of order 10^7 but in your current code you are only checking prime till 500000
So that’s why one case is failing

Ok got it… But I am still not able to think of any code to implement that logic.

I made some changes but it is giving segmentation fault

Please share your code

https://ide.codingblocks.com/s/325225 this is the link to my code

Here changed your code and mentioned in comments