BigInteger in Java and C++


for c++ this link link or google search is good but i didn’t found any goood solution yet:


Simple addition:

 * Created by ZakiHP on 6/11/2017.
import java.util.*;
public class AddNumbers {
    public static void main(String[] args){
        int x,y,z;
        System.out.println("Enter two integers to calculate their sum:");
        Scanner in=new Scanner(;
        System.out.println("Sum of entered integeres:"+z);


BigInt Sum:

import java.math.BigInteger;
import java.util.Scanner;

 * Created by ZakiHP on 6/11/2017.
public class BigInt {

    public static void main(String[] args) {
        String number1, number2;
        Scanner input = new Scanner(;
        System.out.println("Enter first large number:");
        number1 = input.nextLine();
        System.out.println("Enter second large number:");
        number2 = input.nextLine();
        BigInteger first = new BigInteger(number1);
        BigInteger second = new BigInteger(number2);
        BigInteger sum;
        sum = first.add(second);
        System.out.println("Result of addition: " + sum);




It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published. Required fields are marked *