Swap two numbers without using temporary or third variable:
Method 1: Swap numbers using XOR method.
Method 2: Swap numbers using addition & subtraction.
Method 3:Swap numbers using multiplication & division.
----------------------------------------------------------------------------------------------------------------------
Program: to swap two variables without using third variable
https://makeinjava.com/swap-two-numbe...
----------------------------------------------------------------------------------------------------------------------
Java Programs for Beginners:
https://makeinjava.com/core-java-begi...
----------------------------------------------------------------------------------------------------------------------
Website Home Page:
https://makeinjava.com/
----------------------------------------------------------------------------------------------------------------------
It's famous interview question asked by leading software organizations for position of Java Programmer (Developer), Automation Engineer (Tester), SDET.