My code is giving the following error /bin/run.sh: line 4: 18 Segmentation fault (core dumped) ./exe.
Kindly provide me a better code with explanations.
Deepak and Primes
hello @yash_aryan
a)
ur sieve size is not big enough to find 500 000 th prime number.
first check value of 500 000 th prime number and prepare a sieve upto that
b) declare ur array arr as bool to avoid excess memory allocation
and make it global.
Would you please edit my code and send it.
bro have already suggested what u have to do.->
try to do this on ur own(then only u will learn ), if u will stuck anywhere then ping me back with ur updated code
i just allocated memory dynamically and it saved the day
Thanks 
but i think we both need to work according to amas’s method
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.