without using arthematic operation ,how can you write the

Answers were Sorted based on User's Feedback

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

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..

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..

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..

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..

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..

int a = 10;
int b = 5;
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..

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

More Core Java Interview Questions

What is compile time polymorphism?

What are the standards to place package statement within a source code file?

perpare on factorypattern,linklist wothout using collection, (multitharding ie create producer/customer therad producer create Queue continuesly,consumer consume queue, consumer wait if queue is full,producer wait if queue is empty),diff betn sleep(1000)&wait(1000) these r the main Q ask in huawei(2008)

what is ejb? what is the importance of ejb?

What are the operands of instanceof operator?

Difference between Map & Hashmap

Write a program that takes a 5 digit number and calculates 2 power that number and prints it.

Which is not Object in Java?

What is System class and its purpose?

How can you say HashMap is syncronized?

why applet doesn't have main? isn't possible a program with out main?

To set the position and size of a component, which methods are used?

Categories