1import java.*;
2
3class noTemp {
4
5 public static void main(String a[])
6 {
7 int x = 10;
8 int y = 5;
9 x = x + y;
10 y = x - y;
11 x = x - y;
12 System.out.println("After swaping:"
13 + " x = " + x + ", y = " + y);
14 }
15}
1import java.*;
2
3class noTemp {
4
5 public static void main(String a[])
6 {
7 int x = 10;
8 int y = 5;
9 x = x + y;
10 y = x - y;
11 x = x - y;
12 System.out.println(x , y);
13 }
14}