Created
January 24, 2017 23:04
-
-
Save tmosest/00356e61123ca3fd6e2e162e70bd10ee to your computer and use it in GitHub Desktop.
Sieve.java
This file contains 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
public static boolean isPrime(int n) | |
{ | |
for(int i = 0; i * i <= n; i++) | |
if(n % i == 0) | |
return false; | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment