Given two numbers N1 and N2 that are separated by a space, we need to swap first digit of first number with last digit of second number and last digit of first number with the first digit of second number.
The first line of the input contains a single integer T, denoting the number of test cases. Then T test cases follow. Each test case has a single line input where two integers N1 and N2, which are separated by a space, are inputted.
Print two numbers separated by a space such that first digit of first number has been swapped with last digit of second number and last digit of first number has been swapped with the first digit of second number.
Test case 1: 1234 5678
| |_SWAP_| |
Hence we get 8235 4671 as the answer
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.