Last active
August 2, 2016 02:19
-
-
Save joshuaherman/a9c2e87336658fefb0e64d2919ce64be to your computer and use it in GitHub Desktop.
isPrime - Java
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
static boolean isPrime(<T> num) { | |
if (num == 1 || num == 2 || num == 3 || num == 5 || num == 7) { | |
return true; | |
}else if (num % 2 == 0 || num % 5 == 0 || num % 3 == 0) { | |
return false; | |
}else{ | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment