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




Answers were Sorted based on User's Feedback



without using arthematic operation ,how can you write the logic for adding/substraction/multiplica..

Answer / sumalatha

By using bitwise operators, we can implement addition,
subtraction and multiplication operations.

Is This Answer Correct ?    6 Yes 1 No

without using arthematic operation ,how can you write the logic for adding/substraction/multiplica..

Answer / madhusmita pal

using logical operator AND(^)OR(||)and XOR(-).

Is This Answer Correct ?    7 Yes 3 No

without using arthematic operation ,how can you write the logic for adding/substraction/multiplica..

Answer / sankar

Without using arthematic operation adding two numbers:

#include<stdio.h>
int main()
{
int a=5,b=6;
while(b)
{
a=a^b;
b=(a^b)&b;
b=b<<1;
}
printf("The sum of a and b is: %d\n",a);
return 0;
}

Is This Answer Correct ?    1 Yes 0 No




without using arthematic operation ,how can you write the logic for adding/substraction/multiplica..

Answer / xxx

ok without using arthematic operation? give a google search.
am also searching for that.

Is This Answer Correct ?    1 Yes 1 No

without using arthematic operation ,how can you write the logic for adding/substraction/multiplica..

Answer / upendra

plz send the answer for this quary

Is This Answer Correct ?    0 Yes 1 No

without using arthematic operation ,how can you write the logic for adding/substraction/multiplica..

Answer / 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

without using arthematic operation ,how can you write the logic for adding/substraction/multiplica..

Answer / raaaj

visit nataraz.blogspot.com for the answer.you will get a lot of tricky question in future

Is This Answer Correct ?    0 Yes 1 No

Post New Answer



More Core Java Interview Questions

what are the jsp tags with example?

1 Answers   Photon,


what is the context

2 Answers  


How the elements are organized in BorderLayout?

5 Answers  


Difference between Array and vector?

9 Answers  


what is mean by String and StringBuffer? What is mean by Methooverriding and Overloading?

3 Answers   Satyam, STI,






What is JVM ? use of JVM?

6 Answers   Tech Mahindra, BVC,


What is the difference between throw and throws?

5 Answers   Cap Gemini,


Thanks A.jyotsna, Can u tell me differnce between abstract class and interface vikash

4 Answers  


How two different class threads communicate with each other?. send example code.

4 Answers  


which method is used to know the status of the Thread?

9 Answers   Honeywell,


What are the ways of polymorphism other than Overridding & Overloading

1 Answers  


could you run the java program without main method?

6 Answers  






Categories