Update appNew update is available. Click here to update.

Swap Two Numbers

Last Updated: 27 Jan, 2021
Difficulty: Easy

PROBLEM STATEMENT

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'.
Note:
You do not need to print anything, it has already been taken care of. Just implement the given function.
Constraints:
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