please see my code_https://ide.codingblocks.com/s/287506
Code producing wrong answer!
here’s the corrected code
sir ,i initialise all even no as non prime no and try to find out prime no in odd no ,as all prime no are odd no

initiliase all values of the array to 0
and line 10 arr[i]= 1
sir,please reply i will be very thankful to you
can u share the q link where u are trying to submit and getting q answer
along the link share q name
As I pointed out in the corrected code as well, your sieve function is not correct. First of all, while initializing the array, you were just initializing only odd numbers as prime. So , what your code was missing is checking if the number is divisible by 2 or not. That’s why some numbers like 6, 4 were getting printed