Swap Two Numbers

Posted: 27 Jan, 2021
Difficulty: Easy


Try Problem

Take two numbers as input and swap them and print the swapped values.

Input Format:
The first line of input contains a single integer 't', representing the total number of test cases.

The second line of input contains two integers 'a' and 'b', representing the second number. 
Output Format:
The first line of output prints the swapped value of 'a' and 'b'.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= 'T' <= 10^2
-10^5 <= 'a', 'b' <= 10 ^ 5

Time Limit: 1 sec
Approach 1

Take input in two integer datatype variables, a and b. Create a temporary variable temp and initialize it equal to a. Now make a equal to b, and finally make b equal to temp. Print a and b.

Try Problem