/*Wap to add prime numbers between given two numbers by user*/ #include<stdio.h> #include<conio.h> void main() { int a,b,i,j,k; clrscr(); printf("Enter two int to find Prime Numbers between them:\n"); scanf("%d %d",&a,&b); printf("\nPrime Numbers are:\n"); for(i=a;i<b;i++) { k=0; for(j=2;j<i;j++) { if(i%j==0) k=k++; } if(k==0) printf("%d\n",i); } getch(); }
No comments:
Post a Comment