diff --git a/PrimeBigNumber.java b/PrimeBigNumber.java new file mode 100644 index 00000000..07a20381 --- /dev/null +++ b/PrimeBigNumber.java @@ -0,0 +1,30 @@ +import java.io.*; +import java.math.*; +import java.security.*; +import java.text.*; +import java.util.*; +import java.util.concurrent.*; +import java.util.*; + +public class PrimeBigNumber { + + + + private static final Scanner scanner = new Scanner(System.in); + + public static void main(String[] args) + { + String n = scanner.nextLine(); + BigInteger bn=new BigInteger(n); + if(bn.isProbablePrime(1)) + { + System.out.println("prime"); + } + else + { + System.out.println("not prime"); + } + scanner.close(); +} + +} diff --git a/javaBigInteger.java b/javaBigInteger.java new file mode 100644 index 00000000..87b2528d --- /dev/null +++ b/javaBigInteger.java @@ -0,0 +1,21 @@ +import java.io.*; +import java.util.*; +import java.text.*; +import java.math.*; +import java.util.regex.*; + +public class javaBigInteger { + + public static void main(String[] args) { + Scanner sc=new Scanner(System.in); + BigInteger b1=new BigInteger(sc.next()); + BigInteger b2=new BigInteger(sc.next()); + + BigInteger b3,b4; + b3=b1.add(b2); + b4=b1.multiply(b2); + + System.out.println(b3); + System.out.println(b4); + } +}