An interesting use of bitwise XOR

Question | Apr 20, 2016 | hkumar 

Suppose we have these declarations in C++:

int x=10;
int y=20;

What are the values of x and y after following bitwise XOR operations?

x = x ^ y;
y = x ^ y;
x = x ^ y;
2015 nextptr