Desquared interview question

Consider two variables x, y. Swap their data without using a third varaible.

Interview Answer

Anonymous

1 Jun 2023

x = x + y; y = x - y; x = x - y;