#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<iostream.h>
void main()
{
int m,n,k=1;
clrscr();
cout<<"Enter 1st number, m = ";
cin>>m;
cout<<"Enter 2nd number, n = ";
cin>>n;
if(m>=n)
cout<<"m must be less than n.";
else
{
for(int i=m;i<=n;i++)
{
if(i<2)
int p=0;
else
p=1;
int t=sqrt(i);
for(int j=2;j<=t;j++)
if(i%j==0)
{
p=0;
break;
}
if(p==1)
{
cout<<"\n"<<k<<" Prime number = "<<i;
k++;
}
}
}
getch();
}
///////////////////////////////////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........