not able to pass all the testcases help me find out the error
Deepak and primes
for n=100000 you will get a value in range of 10^7 so you have to increase your max value to increase that ( like max=100000004)
here’s the correct code : https://ide.codingblocks.com/s/185987
In case of any doubt feel free to ask 
and if you got the answer mark your doubt as resolved
thank you for the help