-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSwapNumbers.java
More file actions
30 lines (24 loc) · 687 Bytes
/
SwapNumbers.java
File metadata and controls
30 lines (24 loc) · 687 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
25
26
27
28
29
30
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package javaprograming;
/**
*
* @author rohan
*/
public class SwapNumbers {
public static void main(String[] args) {
int num1 = 1;
int num2 = 2;
//int temp = num1;
System.out.println("number orders before swapping "+ num1 +" "+ num2);
swap(num1, num2);
}
public static void swap(int a,int b){
int num1 =b;
int num2 =a;
System.out.println("number after swaping "+num1 +" "+num2);
}
}