Guest User

Untitled

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