A friend and I are going back and forth with brain-teasers and I have no idea how to solve this one. My assumption is that it\'s possible with some bitwise operators, but n
Here's a portable one-line ternary and recursive solution.
int add(int x, int y) { return y == 0 ? x : add(x ^ y, (x & y) << 1); }