Add this library: This is a small example
#include <math.h>
double w, r, d;
d = (sqrt(w)) / r;
This is a discussion on Primes with Sieve of Eratosthenes. within the C Programming forums, part of the General Programming Boards category; Add this library: This is a small example #include <math.h> double w, r, d; d = (sqrt(w)) / r;...
Add this library: This is a small example
#include <math.h>
double w, r, d;
d = (sqrt(w)) / r;
Is it that ?Code:while (n < MAX) { divisible = FALSE; for (i = 0; (i < sqrt(n)) && !divisible; i++) divisible = ((candidat % p[i]) == 0);
Originally Posted by SARAHCPS
I think like that its more slow!
Well try not calling sqrt() so many times - like just ONCE before the loop, not every time within the loop.
How, cannot understand you writte som code pls.Originally Posted by Harbinger
Bored now.....
int limit = sqrt ( fooo );
for (i = 0; i < limit ; i++ )
If you can't get that into your code, give it up