Prime visit poblem

sir it shows segmentation error
sir please tell me mistake in this code

Now it’s working https://ide.codingblocks.com/s/281796

yes bhaiya thanku so much now its working but i don’t understand why we declare array above the prime function not in main function

We need to declare the array of this much size globally in order to avoid segmentation fault.

1 Like

ok bhaiya thanku so much

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.