Not able to figure out the problem. 1 testcase is passing

import java.util.;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t–>0) {
int a = sc.nextInt();
int b = sc.nextInt();
boolean arr[] = new boolean[b+1];
for(int i=0;i<arr.length;i++) {
arr[i] = true;
}
long i;
for(i=2;i
i<=b;i++) {
if(arr[(int)i]==true) {
for(long j=i*i;j<=b;j+=i) {
arr[(int)j]=false;
}
}
}

		if(a==1)
		i=2;
		else
		i=a;
		int count=0;
		for(;i<=b;i++) {
			if(arr[(int)i]==true)
			count++;
			//System.out.println(i);
		}
		System.out.println(count);

	}
}

}

Hi @mudit2jain

Your code doesn’t work for the case
4
1 100
0 1000
33 99
44 1500

The output should be
25
168
14
225

Ok thanks
Now its working