Flipping bits No and Binary Format in Reverse Order
Submissions: 252   Accuracy:

47.23%

  Difficulty: Easy   Marks: 2

You will be given a list of 32 bits unsigned integers. You are required to output the unsigned integers you get by flipping bits in its binary representation (i.e. unset bits must be set, and set bits must be unset) and its binary no in reverse order.

Explanation-
Take 1 for example, as unsigned 32-bits is 00000000000000000000000000000001 and doing the flipping we get 11111111111111111111111111111110 which in turn is 4294967294 and its reverse order is 01111111111111111111111111111111.

Take 2 for example, as unsigned 32-bits is 00000000000000000000000000000010 and doing the flipping we get 11111111111111111111111111111101 which in turn is 4294967293 and its reverse order is 1011111111111111111111111111111.

Input Format-
No of Test cases t, followed by Integer n.

Output Format-
flipped no of n followed by space and then its binary representation in reverse order.

Constraints-
1<=T<=200
0<=n<=
4294967296 (232)

Example:
Input:

2
1

2
Output:
4294967294 01111111111111111111111111111111
4294967293 10111111111111111111111111111111

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

Author: Shubham Nagaria


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.