#include
using namespace std;
int main()
{
long long int m;
long long int n;
int t;
cout<<“enter the number of test cases”<<endl;
cin>>t;
int f;
int i;
int s;
int j;
while(t>0)
{
cout<<"\n enter the values of two integers where m is the lower bound "<<endl;
cin>>m>>n;
for(i=m;i<=n;i++)
{
s=i;
f=0;
for(j=1;j<=s;j++)
{
if(s%j==0)
{
f++;
}
}
if(f==2)
{
cout<<s<<endl;
}
}
t–;
}
return(0);
}
i am getting time limit exceeded in the solution ,can anyone help me please
created
last reply
- 3
replies
- 596
views
- 2
users