my only one test case is passing … sir pls tell whats the error in code
#include
using namespace std;
int isPrime(int a,int b){
int ans=0;
for(int j=a;j<=b;j++){
int count=0;
if(j==1){
count++;
}
if(j==2){
count=0;
}
for(int k=2;k<j;k++){
if(j>2 && j%k==0){
count++;
}
}
if(count==0){
ans++;
}
}
return ans;
}
int main(){
int t;
cin>>t;
int ans_arr[1000];
for(int i=0;i<t;i++){
int a,b;
cin>>a>>b;
int p=isPrime(a,b);
ans_arr[i]=p;
}
for(int i=0;i<t;i++){
cout<<ans_arr[i]<<endl;
}
return 0;
}