Java Primality Test

  • + 0 comments

    Just add this to the main method :)

            if((new BigInteger(n).isProbablePrime(100)))
                System.out.println("prime");
            else 
                System.out.println("not prime");