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

why interaction with server using javascript is difficult

1 Answers  


How many types of keywords are there?

0 Answers  


What is object-oriented programming?

0 Answers  


Is vector synchronized in java?

0 Answers  


Can I declare class as static or private?

0 Answers  






how to write a program for chat function using core java

1 Answers   Satyam,


What is difference between Heap and Stack Memory?

0 Answers  


What will happen if there is a default method conflict as mentioned above and we have specified the same signature method in the base class instead of overriding in the existing class ?

0 Answers  


Is a method a procedure?

0 Answers  


What is the destroy method?

0 Answers  


I have one POJO class(Java bean class), it has two variables for that it has setters and getters. Now i have created two objects for that class and i have set the data for those variables through this two objects. Now question is i want check whether those two objects have same data or not, for this write a program? Thanks, Bose.

2 Answers   Oracle,


What is Java Shutdown Hook?

0 Answers  


Categories