Skip to content

Instantly share code, notes, and snippets.

@ejrh
Last active August 29, 2015 14:11
Show Gist options
  • Save ejrh/e84f0da24f5814fec3a7 to your computer and use it in GitHub Desktop.
Save ejrh/e84f0da24f5814fec3a7 to your computer and use it in GitHub Desktop.
//#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