Guest User

Untitled

a guest
Jan 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. static boolean isPrime(int input) {
  2. int j = 0;
  3. if(input%2==0){
  4. return false;
  5. }
  6. else{
  7. for (int i = 1; i <= Math.sqrt(input); i++) {
  8. if (input % i == 0) {
  9. j = j+2;
  10. }
  11. }
  12. if (j <= 2) {
  13.  
  14. return true;
  15. }
  16. return false;
  17. }
  18. }
Add Comment
Please, Sign In to add comment