You are on page 1of 1

#include<stdio.h> #include<math.

h> void main() { int i, prime, lim_up, lim_low, n,nth num,count=0; clrscr(); printf( \n\n\t ENTER THE LOWER LIMIT : ); scanf( %d , &lim_low); printf( \n\n\t ENTER THE UPPER LIMIT : ); scanf( %d , &lim_up); printf( \n\n\t the %2d prime number to be found in the range is: scanf("%d', $ nth num); for(n=lim_low+1; n<lim_up; n++) { prime = 1; for(i=2; i<n; i++) if(n%i == 0) { prime = 0; break; } if(prime) printf( \n\n\t\t\t%d , n); count=count+1; } getch(); }

);

You might also like