Run time error!

please debug my code.
link to my code-https://ide.codingblocks.com/s/287060

@pulkit_pandey09 make your variables as long long and then try (in the sieve function)

still not able to pass the test case. https://ide.codingblocks.com/s/287060

@pulkit_pandey09 initialise the prime array with 0 first, you just initialised the odd values others might be containing garbage values

Not able to pass all the test cases. Please edit my code.https://ide.codingblocks.com/s/287060

@pulkit_pandey09 your logic seems fine, please try once by making all the variables long long, try the code and let me know if it doesnt work

getting runtime error for all the test cases. please edit my code - https://ide.codingblocks.com/s/287060

@pulkit_pandey09 size of arrays is big so best to make them a global variable: https://ide.codingblocks.com/s/289926

@pulkit_pandey09 please mark this doubt as resolved :slight_smile:

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.