my code gives segmentation fault if i use int instead of long int for a and b, where constraints were,a<b<1000000, but passes correctly if i used long int. why is that even though range of int is till (2^32-1) which is greater than the constraints.
Prime visits constraint doubt
This line for(long int j = i*i;j<=1000000;j = j+i)
i is going up to 10^6 so you are trying to store 10^12 in j, which is greater than the range of j, so it overflows