Encountering segmentation fault

@shahnawaz
hello shahnawaz ,
ur sieve size should be greater than 5000 000th prime number.

so check 5000 000th prime number and declare u sieve size bigger than that.

also if ur cnt==n then print i and break the loop . no need to iterate furthur.

still getting segmentation fault after correcting my code https://ide.codingblocks.com/s/204444

@shahnawaz
check ur corrected code hrere -> https://ide.codingblocks.com/s/204446
i have made p array global because we cannot declare a big size array inside any function.

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.