Deepak and Primes

My code is giving wrong answer for last test case.

hi @56amrut.bhokardankar, your code is correct , you just need to increase the size of array s (also declare it global) to 10^8 to calculate as much as 5000000 prime numbers, also have s as boolean array as it will take less memory compared to int (else you will get memory limit exceeded)
here i have corrected your code :- https://ide.codingblocks.com/s/241406