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
Science,
19 days ago
Environmental Sciences,
19 days ago
Science,
19 days ago
English,
1 month ago
English,
9 months ago
World Languages,
9 months ago