How to add two numbers without using arithmetic operators?
Answer Posted / selloorhari
Hi Nitish,
If we will do the LOGICAL OR function then we will get
either 1 or 0.
If we will do the BITWISE OR then we will get the largest of
the two..
For
ex:
Let us take, First number as 2 and Second number as 3..
Then as per the first case we will get 1 as the output.
10(2) || 11(3) -> 1(1)
As per the second case the output will be 3..
10(2) | 11(3) -> 11(3).
Ok
| Is This Answer Correct ? | 14 Yes | 12 No |
Post New Answer View All Answers
Write a program to print factorial of given number without using recursion?
Explain the difference between exit() and _exit() function?
Is there a way to compare two structure variables?
Explain what is the benefit of using enum to declare a constant?
Is null always defined as 0(zero)?
In a header file whether functions are declared or defined?
What does a function declared as pascal do differently?
what are enumerations in C
What do you mean by recursion in c?
Can a pointer be volatile in c?
write a program to concatenation the string using switch case?
What is a lookup table in c?
Is fortran faster than c?
What are types of preprocessor in c?
What does %c mean in c?