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