DEV Community

Discussion on: How can you swap two variables without using a third?

Collapse
 
tux0r profile image
tux0r

x = 1 + 1
y = 2 - 1
x = 2 - 1

Nope, still true.

Thread Thread
 
sadarshannaiynar profile image
Adarsh

Sorry perceived wrongly my mistake. Deleted the previous comment. But the possibility of overflow is still there in this method.