we can do in a single line using compound assignment tooo......
x^=y^=x^=y;

the above too will work


thank u
SaswatPadhi like this