Tuesday, November 25, 2008

Replace variable values

Do You know how to replace variable values without using third variable?





int x = 100;
int y = 200;

x ^= y;
y ^= x;
x ^= y;


No comments: