Pandiyan Mani
Aug 25, 2021

--

Swap two numbers in java without temp

int x=10,y=5;

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


System.out.println("x value is "+x+" Y value is "+y);

--

--