Created
March 12, 2009 10:22
-
-
Save anshumanatri/78012 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void gen_primes() | |
{ | |
int i,j; | |
for(i=0;i<MAX;i++) primes[i] = 1; | |
for(i=2;i<=(int)sqrt(MAX);i++) | |
if (primes[i]) | |
for(j=i;j*i<MAX;j++) primes[i*j] = 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment