import java.util.Scanner;
public class SwapTwoNumbersXOR {
public static void main(String[] args) {
int x, y;
Scanner in = new Scanner(System.in);
System.out.println("Enter the value of x: ");
x = in.nextInt();
System.out.println("Enter the value of y: ");
y = in.nextInt();
System.out.println("Before swapping: ");
System.out.println("x = " + x + ", y = " + y);
// XOR swap algorithm
x = x ^ y;
y = x ^ y;
x = x ^ y;
System.out.println("After swapping: ");
System.out.println("x = " + x + ", y = " + y);
}
}