If that:
Known: int a = 3, b = 6; if not by the third variable is how to achieve a, b swap?
Individual solution:
a = a+b;
b = a-b;
a = a-b;
Later we found there is a method (XOR operation), as follows:
a = a^b;
b = a^b;
a = a^b;
If that:
Known: int a = 3, b = 6; if not by the third variable is how to achieve a, b swap?
Individual solution:
a = a+b;
b = a-b;
a = a-b;
Later we found there is a method (XOR operation), as follows:
a = a^b;
b = a^b;
a = a^b;