Write a program in Java to input two unequal numbers. Display the numbers after swapping their values in the variables without using a third variable. Sample Input: a = 3, b = 6 Sample Output: a = 6, b = 3
Answers
Answered by
0
Answer:
You can understand the main logic from the below part
Explanation:
after taking the inputs main part is
a=a+b;
b=a-b;
a=a-b;
after this you have to print the numbers and you will see that both are swapped
Similar questions