How do I add two numbers without using ++ or + or any other arithmetic operator?
It was a question asked a long time ago in some campus interview. Anyway, today some
With given answers above, it can be done in single line code:
int add(int a, int b) { return (b == 0) ? a : add(a ^ b, (a & b) << 1); }