Swap Two Numbers without using a Third variable in java
import java.util.*;
class Swapping
{
public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
System.out.print("Enter First Number : ");
int n1=s.nextInt();
System.out.print("Enter Second Number : ");
int n2 = s.nextInt();
n1 = n1 + n2;
n2 = n1 - n2;
n1 = n1 - n2;
System.out.println("\nAfter swapping");
System.out.println(" Number 1= " + n1 + " \n Number 2= " + n2);
}
}