can someone please tell me why my code for prime generation is wrong
#include
#include
#include
#include
#include<math.h>
using namespace std;
map<char,int> ma;
void primee(int m, int n);
int main()
{
int t,i,m,n,min=0,max=0;
cin>>t;
for(i=0;i<t;i++)
{
cin>>m>>n;
primee(m,n);
cout<<endl;
}
return 0;
}
void primee(int m, int n)
{
int i=m,val=1,j;
if(m==1 || m==0)
m= 2;
for(i=m;i<=n;i++)
{
val=1;
if(ma.count(i))
{
cout<<i<<endl;
continue;
}
for(j=2;j<=sqrt(i);j++)
{
if(i%j==0)
{
val=0;
break;
}
}
if(val==1)
{
cout<<i<<endl;
ma[i]=1;
}
}
}