Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

big integer input in java

import java.math.BigInteger;  
import java.util.*;  
public class ScannerNextBigIntegerExample1 {    
    public static void main(String args[]){    
          System.out.print("Enter BigInteger Number to check prime: ");;  
          Scanner in = new Scanner(System.in);  
        BigInteger n = in.nextBigInteger();  
        in.close();  
        System.out.println(n.isProbablePrime(1) ? "prime" : "not prime");  
      }    
}  
 
PREVIOUS NEXT
Tagged: #big #integer #input #java
ADD COMMENT
Topic
Name
7+3 =