How do you swap two numbers without using the third variable in Java
![](https://cdn-icons-png.flaticon.com/512/226/226777.png)
Java
🤖 Code Explanation
This is a simple code to swap two numbers using arithmetic operations.
![](https://cdn-icons-png.flaticon.com/512/226/226777.png)
More problems solved in Java
![](https://cdn-icons-png.flaticon.com/512/226/226777.png)
![](https://cdn-icons-png.flaticon.com/512/226/226777.png)
![](https://cdn-icons-png.flaticon.com/512/226/226777.png)
![](https://cdn-icons-png.flaticon.com/512/226/226777.png)
![](https://cdn-icons-png.flaticon.com/512/226/226777.png)
![](https://cdn-icons-png.flaticon.com/512/226/226777.png)
![](https://cdn-icons-png.flaticon.com/512/226/226777.png)
![](https://cdn-icons-png.flaticon.com/512/226/226777.png)
![](https://cdn-icons-png.flaticon.com/512/226/226777.png)
![](https://cdn-icons-png.flaticon.com/512/226/226777.png)
![](https://cdn-icons-png.flaticon.com/512/226/226777.png)
![](https://cdn-icons-png.flaticon.com/512/226/226777.png)
![](https://cdn-icons-png.flaticon.com/512/226/226777.png)
![](https://cdn-icons-png.flaticon.com/512/226/226777.png)
This is a simple code to swap two numbers using arithmetic operations.
Download SpellBox today Download SpellBox for macOS, Windows and VS Code today. Solve any programming or engineering problem with A.I.