Sum of Two Integers
mediumAdd two integers without using + or - operators
Sum Without + or -
Key Insight
XOR gives sum without carry. AND << 1 gives carry. Repeat until no carry.
Step 1Problem
5
5
=0
0
0
0
0
1
0
1
3
3
=0
0
0
0
0
0
1
1
76543210
0101 + 0011
Add 5 + 3 without using + or -.
1 / 5