i have checked code there is no infinite loop issue but only one testcase is showing up timelimit error.
code is as :
#include
using namespace std;
int main() {
int n;
cin>>n;
while(n>0)
{
long long a;
long long b;
cin>>a;
cin>>b;
long long noc=0;
for(long long i=a;i<=b;i++ )
{
long long j;
for(j=2;j<i;j++)
{
if(i%j==0)
{
break;
}
}
if(j==i)
{
noc++;
}
}
cout<<noc<<endl;
n–;
}
return 0;
}