forked from badal74/java-codes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuestion7.java
More file actions
15 lines (15 loc) · 470 Bytes
/
Copy pathQuestion7.java
File metadata and controls
15 lines (15 loc) · 470 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
public class Question7 {
public static void main(String arg[]) {
System.out.println("Before swapping");
int x = 10;
int y = 20;
System.out.println("value of x:" + x);
System.out.println("value of y:" + y);
System.out.println("After swapping");
x = x + y;
y = x - y;
x = x - y;
System.out.println("value of x:" + x);
System.out.println("value of y:" + y);
}
}