#include <stdio.h>
#include<math.h>
int main() {
int a,b,i,j, flag;
printf("enter lower bond of interval \n");
scanf("%d",&a); //TAKE INPUT
printf("enter upper bond of interval \n");
scanf("%d",&b);
printf("prime no between %d and %d are: \n",a,b);
for(i=a;i<=b;i++) {
if (i==1 || i==0)
continue;
flag=1; //flag means means
for (j=2;j<=i/2; ++j) {
if(i%j ==0){
flag = 0;
break;
}
}
if (flag == 1)
printf("%d\n",i);
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: