Home | History | Annotate | Download | only in auxprogs
      1 
      2 #include <stdio.h>
      3 #include <math.h>
      4 
      5 int isprime ( int n )
      6 {
      7    int m;
      8    int sqrt_n = sqrt(n);
      9    for (m = 2; m <= sqrt_n+1; m++)  // +1 in case of obscure rounding error
     10       if ((n % m) == 0) return 0;
     11    return 1;
     12 }
     13 
     14 int main ( int argc, char** argv )
     15 {
     16    int i;
     17    for (i = 79000; i < 81000; i++)
     18      if (isprime(i)) { printf ( "%d ", i ); fflush(stdout); }
     19    return 0;
     20 }
     21