Given a number N and the task is to print the first and last digit of N.
The first line of the input contains a single integer T, denoting the number of test cases. Then T test case follows, a single line of the input containing a positive integer N.
For each testcase, print a single line containing the first and last digit of N respectively.
For testcase 1: First digit of 12345 is 1 and last is 5.
For testcase 2: First digit of 98562 is 9 and last is 2.
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.