Reverse Bits
Submissions: 11108   Accuracy:

50.58%

  Difficulty: Easy   Marks: 2
Associated Course(s):   Sudo Placement 2019

Given a 32 bit number x, reverse its binary form and print the answer in decimal.

Input:
The first line of input consists T denoting the number of test cases. T testcases follow. Each test case contains a single 32 bit integer

Output:
For each test case, in a new line, print the reverse of integer.

Constraints:
1 <= T <= 100
0 <= x <= 4294967295

Example:
Input:
2
1
5

Output:
2147483648
2684354560

Explanation:
Testcase1:

00000000000000000000000000000001 =1
10000000000000000000000000000000 =2147483648

** For More Input/Output Examples Use 'Expected Output' option **

Author: bhawnamait


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.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.