please check the code…please tell me why its not working for other test cases
#include
using namespace std;
int main() {
int N;
cin>>N;
for(int i=0;i<N;i++)
{
int a=0;
int b=0;
cin>>a>>b;
if(a==1)
{
a++;
}
int count=0;
int flag=1;
for(int j=a;j<=b;j++)
{
for(int i=2;i<j;i++)
{
if(j%i!=0)
{
flag=1;
}
else
{
//cout<<" for u";
flag=0;
break;
}
}
if(flag==1)
{
//cout<<"hello"<<" ";
count++;
}
else
{
//cout<<" aaja aaja";
}
}
cout<<count<<endl;
}
return 0;
}