Prime Visits problem ,Please look into my code,What is wrong in here?

#include
#include <math.h>
using namespace std;
int isprime(int n){
if(n==1)
return 0;
for(int i=2;i<=sqrt(n);i++)
{
if(n%i==0)
return 0;
}
return 1;
}
int main()
{
int n;
cin>>n;
for(int z=0;z<n;z++)
{
int a,b,count=0;
cin>>a>>b;
for(int i=a;i<=b;i++)
{
if(isprime(i))
count++;
}
cout<<count<<endl;
}
return 0;
}

@sattyrajpoot39 hey Satyam this problem is designed to teach you to the algorithm name sieve of Eratosthenes you go and watch the video in your course of the sieve of Eratosthenes