How do you swap two numbers without using the third variable in C++
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
C++
🤖 Code Explanation
The code swaps the values of two variables.
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
More problems solved in C++
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
![](https://cdn-icons-png.flaticon.com/512/6132/6132222.png)
The code swaps the values of two variables.
Download SpellBox today Download SpellBox for macOS, Windows and VS Code today. Solve any programming or engineering problem with A.I.