Created
April 11, 2019 06:06
-
-
Save Alex4386/99af8680bf5ae036e0e2ffa463f005ba 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> | |
int main() { | |
for (int num = 2; num < 100000000 ; num++) { | |
bool isPrime = true; | |
for (int i = 2; i <= (num / 2); i++) { | |
if (num % i == 0) { | |
isPrime = false; | |
break; | |
} | |
} | |
if (isPrime) { | |
printf("%d is prime!\n", num); | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment