Question: C programming language !!! This assignment will allow you to practice more with the bit wise operatons and shifts. Consider the following modification of the
This assignment will allow you to practice more with the bit wise operatons and shifts. Consider the following modification of the micin program froan HW3: \#include void set-flag (unsigned int * flag-holder, int flag-position): void unset-flag (unsigned int = flag-holder, int flag-position): int check-flag (unsigned int flag-holder, int flag-position); void display-32-flags (unsigned int flag-holder); int main (int arge, char: argv []) \{ unsigned int flag-holder =0 set-flag (\&flag-holder , 3); set-flag (kflag-holder, 16); set-flag (\&flag-holder, 31): display-32-flags (flag-holder): unset-flag (\&flag-holder, 31); unset-flag (\&flag-holder , 3); set-flag (R-flag-holder, 9); display-32-flags (flag-holder): return 0 ; \} Write the code for the definition of set. Alag and check flag so that the output of your program looks like the following: 10000000000000010000000000001000 00000000000000010000001000000000 You can think of the unset.flag function as taking an integer and making sure that the nth bit is a 0 . You may finde the operator useful. It is used to "flip the bits" of a mumber making all the zero values. 1 's and all the 1's zeroes. As in the previous assignment, the shifting operators and the bitwise and ( se ) and or (| ) may atso be useful. If you are doing multiplication or division then you are doing it wrong. The display- 32 flags function should just print the information to the sereen as was given in the previous assignment (just turn it into a function instead). At the top of your code you should have a comment section that has the following format: Author: Date: Effort: Time you spent on this project> Purpose
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
