Question: Write a program that displays the binary representation of an integer as a '1' is shifted through all 32 bits of an integer storage location.

Write a program that displays the binary representation of an integer as a '1' is shifted through all 32 bits of an integer storage location. Also print the: - Decimal value of the integer - The decimal value of each byte in the integer - The binary value of each byte in the integer Use the program from the examples, binary.c, as a starting point Ex: -- Integer: 1 Binary: 00000000000000000000000000000001 Bytes: 1 0 0 0 Binary: 00000001 00000000 00000000 00000000 Integer: 2 Binary: 00000000000000000000000000000010 Bytes: 2 0 0 0 Binary: 00000010 00000000 00000000 00000000 Integer: 4 Binary: 00000000000000000000000000000100 Bytes: 4 0 0 0 Binary: 00000100 00000000 00000000 00000000 . . . Integer: 2147483648 Binary: 10000000000000000000000000000000 Bytes: 0 0 0 128 Binary: 00000000 00000000 00000000 10000000 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!