daily pastebin goal
9%
SHARE
TWEET

Untitled

a guest Mar 8th, 2018 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top