QuestionAsk Questions?

View Answers

June 12, 2009 at 3:36 PM

Hi Friend,

Yes, you can use BigInteger class to add, subtract,multiply,divide the numbers:

import java.math.BigInteger;

public class AddNumbers

{

public static void main(String[] args)

{

BigInteger bigInteger1 = new BigInteger ("24");

BigInteger bigInteger2 = new BigInteger ("35");

BigInteger bigIntResult =

bigInteger1.add(bigInteger2);

System.out.println("Result is ==> " + bigIntResult);

}

}

Thanks

Yes, you can use BigInteger class to add, subtract,multiply,divide the numbers:

import java.math.BigInteger;

public class AddNumbers

{

public static void main(String[] args)

{

BigInteger bigInteger1 = new BigInteger ("24");

BigInteger bigInteger2 = new BigInteger ("35");

BigInteger bigIntResult =

bigInteger1.add(bigInteger2);

System.out.println("Result is ==> " + bigIntResult);

}

}

Thanks

March 17, 2011 at 12:38 PM

Create a simple java program that adds, subtracts, divides and multiplies any two numbers that are entered by a user.

Related Tutorials/Questions & Answers: