#include<stdio.h>
#include<conio.h>
void main( )
{
int a,b,i,flg;
printf("Enter interval of two numbers: ");
scanf("%d%d",&a,&b);
for(j=a+1; j<=b; j++)
{
flg=0;
for(i=2;i<=j/2;i++)
{
if(j%i==0)
{
flag=1;
break;
}
}
if(flag==0)
printf("%d\t",n);
}
getch( );
Point out the defect of this program.
ReplyDelete