Introducing interesting programs for you
#include<stdio.h> #include<math.h> main() { int n1,n2,i,j,flag; printf("Enter 2 numbers\n"); scanf("%d %d",&n1,&n2); for(i=n1+1 ; i<n2 ; i++) { flag = 0; for(j=2 ; j<=sqrt(i) ; j++) { if(i%j==0){ flag=1; break; } } if(flag==0) printf("%d\t",i); } }
No comments:
Post a Comment