Prime Generator

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;
        
    }
	
}

}

@abhilash_1997

map<char,int> ma;

Character key for map<> is incorrect for the i/p constraints of the question as “char” will overflow giving wrong value of key.

eg. It shows 999 as prime because char value for 999 overflows to char value of -25.

So, you should use long int instead of char.