Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzairmemon1 authored Oct 9, 2022
1 parent 9b622d2 commit 7072d3e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Java/swapwithoutusingthirdvariable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
public class swapwithoutusingthirdvariable {
public static void main(String[] args) {
int a = 10;
int b = 15;
System.out.println("Before Swap: " + a + " " + b);
a= a+b;
b= a-b;
a= a-b;
System.out.println("After Swap: "+a + " "+ " " + b );
}
}

0 comments on commit 7072d3e

Please sign in to comment.