i need help with prime1. joined new herel. here is my code
#include<iostream.h>
#include<stdio.h>
main()
{
int i,m,n,p=0;
int x,flag=1;
cin>>x;
int a[20];
for(i=0;i<(2*x);i++)
{
cin>>a[i];
}
for(i=0;(i<x)&&(i<10);(i++),p=p+2)
{
m=a[p];n=a[p+1];
for(int j=m;(j<=n)&&((n-j)<=100000);j++)
{
flag=1;
for(int k=2;k<=(j/2);k++)
{
if((j%k)==0)
{
flag=2;
break;
}
}
if((flag==1)&&(j!=1))
{
cout<<j<<endl;
}
}
cout<<endl;
}
cin>>x;
}
kindly help me out