- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSwap_two_number.java
More file actions
Latest commit
24 lines (23 loc) · 570 Bytes
/
Copy pathSwap_two_number.java
File metadata and controls
24 lines (23 loc) · 570 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
importjava.util.Scanner;
// Import Scanner Module
classSwap_two_number{
// Create Main Class
publicstaticvoidmain(Stringargs[]){
// Create Main Class
Scannerobj= newScanner(System.in);
// Create Input Scanner
inta,b;
System.out.println("Enter the Value of A");
// First Input Integer
a=obj.nextInt();
System.out.println("Enter The Value of B");
b=obj.nextInt();
// Second Input Integer
// Swap Logic | using temp variable
inttemp;
temp=a;
a=b;
b=temp;
System.out.println("A is "+a+"B is "+b);
}
}