Skip to main content

Add two numbers using bitwise operators

Basically plus (+) operators are used to perform addition of two numbers in programming language. Can it is possible to perform addition of two number without using those operator (+,-,++,--). Ans is yes.

By using following bitwise operator (&,^,<<) we can perform addition operation.

Tip

The time complexity increases when the bits are added by the bitwise operator. Because we will need a loop to do the addition.

Program List





Comment

Please share your knowledge to improve code and content standard. Also submit your doubts, and test case. We improve by your feedback. We will try to resolve your query as soon as possible.

New Comment