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
What are the advantages of external class?
What is #include called?
What are the restrictions of a modulus operator?
How can a program be made to print the line number where an error occurs?
Implement bit Array in C.
What is a null pointer in c?
What is selection sort in c?
What are types of structure?
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
What is meant by recursion?
What type of function is main ()?
What is the difference between the local variable and global variable in c?
diff between exptected result and requirement?
Can a variable be both const and volatile?
What are the features of the c language?