Swap two numbers without using third variable in java (3 Methods)

Опубликовано: 04 Октябрь 2024
на канале: TechGiant
44
3

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.