Computer Science, asked by mohitmallick2005, 1 month ago

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 akichanbaby650
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