Company: Applogic networks_Software engineer intern_Oncampus_21july
Difficulty: easy
Write a function that takes an unsigned integer as an argument and returns an unsigned integer that represents the binary reversal of the number. The number is treated as a 32-bit unsigned integer, so the reversal is of all 32 bits, leading zeros included. For example, if the number were represented in 16 bits as 0000000000001011 , its 16-bit reversal would be 1101000000000000 ; here the same idea is applied over the full 32-bit width. Input Format The first line contains an integer Q , the number of values to convert. Each of the next Q lines contains one unsigned 32-bit integer. Output Format Print Q lines. Line i contains the 32-bit binary reversal of the i th input value, printed as an unsigned decimal integer. Constraints 1 ≤ Q ≤ 1500 0 ≤ value ≤ 2 32 - 1 Sample Input 1 11 Sample Output 3489660928 Explanation. 11 as a 32-bit number is 00000000000000000000000000001011 . Reversing all 32 bits gives 11010000000000000000000000000000 , which is 3489660928 in decimal.