Last active
August 29, 2015 14:11
-
-
Save ejrh/e84f0da24f5814fec3a7 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
//#include <stdio.h> | |
void main() { | |
int max; | |
max = 10000; | |
int candidate; | |
candidate = 2; | |
while (candidate < max) { | |
int divisor; | |
divisor = 2; | |
while (divisor < candidate) { | |
int multiple; | |
multiple = 0; | |
while (multiple < candidate) { | |
multiple = multiple + divisor; | |
} | |
if (multiple == candidate) { | |
break; | |
} | |
divisor = divisor + 1; | |
} | |
if (candidate == divisor) { | |
__out__(candidate, 18); | |
//printf("%d\n", candidate); | |
} | |
candidate = candidate + 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment