without using arthematic operation ,how can you write the
logic for adding/substraction/multiplication?

Answer Posted / ashwinkumar

int a = 10;
int b = 5;
int sum = BigInteger.valueOf(a).add(BigInteger.valueOf(b)).intValue();
int sum1 = BigInteger.valueOf(a).subtract(BigInteger.valueOf(b)).intValue();
int sum2 = BigInteger.valueOf(a).multiply(BigInteger.valueOf(b)).intValue();

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a pattern what is an anti pattern?

498


How do you reverse a list?

544


How the interruptible method gets implemented?

548


What is the generic function?

518


What is nan in java?

510






Is math an abstract class in java?

527


What is the equal sign?

553


What is use of a abstract variable?

528


Why charat is used in java?

534


What are meta-annotations?

545


What is a ternary operator in java? What is an interface?

541


What is a byte string?

609


What is type safety in java?

478


What is continuity of a function?

515


What is the constructor?

572