This is a brain teaser like question. Assume you have a and b.
a = a+b;
b = a – b; //now b equals the original a.
a = a – b; //now a equals the original b.
You could also use the xor, remember that xor will turn different digits to 1 and same digit to 0
a = a xor b // now record the different bit by marking the corresponding bit 1
b = a xor b // flip the bit in b if corresponding bit in a is 1, keep the same when it is 0 now b equals the original a
a = a xor b // same as the previous step, now a equals to the original b.