Question: Write a program in C language that lets a user manipulate bits individually in a 4-byte variable. The program should begin with all bits having

Write a program in C language that lets a user manipulate bits individually in a 4-byte variable. The program should begin with all bits having a value of zero. The program should enter a loop where it prints out the current bit values as a single integer using the twos complement bit model. It should then prompt the user to either set a bit, clear a bit, or exit. If the user desires to set a bit or clear a bit, then the programshould prompt the user for which bit, change the appropriate value, and then cycle back to the beginning of the loop. Setting a bit changes its value to 1 regardless of its current value; clearing a bit changes its value to 0 regardless of its current value.

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!