Swapping two variables without using another variable (Arithmetic Operator)

Swapping two variables without using another variable (Arithmetic Operator)
a = 5 b = 10 a = a + b b = a - b a = a - b print(a, b) 10 5
I found this algorithm interesting.
Example made in Python

No comments:

Post a Comment