Swap Two Numbers Without Using a Third Variable
Your task is to swap two given numbers without utilizing an additional variable and print the swapped values.
Input:
The first line contains an integer 't', indicating the number of test cases.
The following lines each contain two integers 'a' and 'b'.
Output:
For each test case, output the swapped values of 'a' and 'b' as a single line.
Example:
Input:
2
3 7
10 5
Output:
7 3
5 10
Constraints:
- 1 <= 't' <= 100
- -105 <= 'a', 'b' <= 105
Note:
Focus only on implementing the given function, as output handling is already managed.
Be the first one to answer
Add answer anonymously...
Top Wunderman Thompson Commerce Java Developer interview questions & answers
Popular interview questions of Java Developer
>
Wunderman Thompson Commerce Java Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app