Problem prime visits

what is wrong with my code

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner cin = new Scanner(System.in);
long t = cin.nextLong(),count = 0;
while(t>0){
int count = 0 ;
long a=cin.nextLong(),b=cin.nextLong();
for(long i = a;i<=b;i++){
for(long j = i+1;j<=b;j++){
if(i%j!=0){
count++;
}
}
}
System.out.println(count);
t–;
}
}
}

@AbhishekAhlawat1102
Your logic is incorrect here,as you are counting the divisors between two numbers.
However the problem is much simple.We just need to tell the count of numbers having two divisors between a and b.
Revert back here with the correct logic.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.