Java BigInteger

Sort by

recency

|

355 Discussions

|

  • + 0 comments

    the WGU Student Portal also plays a significant role in fostering a sense of community among students. Even though WGU Enrollment Portal is an online university, the portal includes discussion boards, peer networking spaces, and links to virtual events and communities. These features allow students to connect with others in their degree program, share insights, offer mutual support, and collaborate on academic and professional development. This sense of belonging can be crucial for motivation and persistence, particularly for adult learners who may be returning to school after years away from formal education.

  • + 0 comments
    import java.io.*;
    import java.util.*;
    import java.math.*;
    
    public class Solution {
    
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            
            BigInteger a = sc.nextBigInteger();
            BigInteger b = sc.nextBigInteger();
        
            sc.close();
            
            System.out.println(a.add(b));
            System.out.println(a.multiply(b));
        }
    }
    
  • + 0 comments
    import java.io.*;
    import java.util.*;
    import java.text.*;
    import java.math.*;
    import java.util.regex.*;
    
    public class Solution {
    
        public static void main(String[] args) {
            /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
            Scanner sc = new Scanner(System.in);
            BigInteger valueA = new BigInteger (sc.next());
            BigInteger valueB = new BigInteger (sc.next());
            
            sc.close();
            
            System.out.println(valueA.add(valueB));
            System.out.println(valueA.multiply(valueB));
        }
    }
    
  • + 0 comments

    Here's using BufferedReader

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String num1 = br.readLine().trim();
            String num2 = br.readLine().trim();
            br.close();
            BigInteger n1 = new BigInteger(num1);
            BigInteger n2 = new BigInteger(num2);
            System.out.println(n1.add(n2));
            System.out.println(n1.multiply(n2));
    
  • + 0 comments

    Scanner scan = new Scanner(System.in); BigInteger a = new BigInteger(scan.nextLine()); BigInteger b = new BigInteger(scan.nextLine()); System.out.println(a.add(b)); System.out.println(a.multiply(b));