- 1
Write a program to add two numbers without using arithmetic operators.
You have to take two numbers from user and calculate the sum. Actually i have to know how the bitwise operators work in this program. I couldn't able to understand the working over XOR AND & << op.
1 Odpowiedź
+ 1
You first need to know bit representations of integers. Then you can do the rest.
If you do know, then you can try doing something like that.
For example take two numbers.
Like 34 and 20. Sum them up.
Then try to find a relationship between the result and those two numbers. And try to find how you can achieve this.