Can anyone help in this code of segmented seive? getting WA in problem prime1

I am unable to find errors in this code but getting WA for this problem.

please help.