swap two numbers without using temporary variable
Anonymous
Sagar's answer is decent, but there might be problems if they consider overflow. Better is using xor: b = a XOR b a = a XOR b b = a XOR b
Check out your Company Bowl for anonymous work chats.