Program:
import java.util.*;
public class SwapWithout
{
public static void main(String[] args)
{
int x = 100;
int y = 200;
x = x + y;
y = x - y;
x = x - y;
System.out.println("X=" + x + " and Y=" + y);
}
}
Compile:
javac SwapWithout.java
java SwapWithout
Output:
X=200 and Y=100