Given an unsigned integer N. The task is to swap all odd bits with even bits. For example, if the given number is 23 (00010111), it should be converted to 43(00101011). Here, every even position bit is swapped with adjacent bit on right side(even position bits are highlighted in binary representation of 23), and every odd position bit is swapped with adjacent on left side.
The first line of input contains T, denoting the number of testcases. Each testcase contains single line.
For each testcase in new line, print the converted number.
1 ≤ T ≤ 100
1 ≤ N ≤ 100
Testcase 1: BInary representation of the given number; 00010111 after swapping 00101011.
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.