#include<stdio.h>
#include<conio.h>
void main()
{ int num1,num2,i,flag;
printf("Enter 2 no.");
scanf("%d%d",&num1,&num2);
while(num1<=num2)
{
i=2;
while( i<num1)
{
if(num1%i==0)
{
flag=0;
break;
}
else
{
flag=1;
}
i++;
}
if(flag==1)
printf("%d",num1);
num1++;
}
}
Output
enter 2no.
1
10
357
No comments:
Post a Comment