For two testcases no output is displaying

You are supposed to solve this question using seive of erathosenes, try implementing that using the online video lecture given in number theory basics.

yaa i used seive of eratostenes only.please check the code


I have made small changes to your code, try to submit now.