forked from badal74/java-codes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSwapNumbers.java
More file actions
19 lines (14 loc) · 536 Bytes
/
Copy pathSwapNumbers.java
File metadata and controls
19 lines (14 loc) · 536 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public class SwapNumbers {
public static void main(String[] args) {
int first = 12, second = 24;
System.out.println("--Before swap--");
System.out.println("First number = " + first);
System.out.println("Second number = " + second);
first = first - second;
second = first + second;
first = second - first;
System.out.println("--After swap--");
System.out.println("First number = " + first);
System.out.println("Second number = " + second);
}
}