Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C programming This daily will allow you to practice more with the bit wise operators and shifts. Consider the following modification of the main program

C programming image text in transcribed
This daily will allow you to practice more with the bit wise operators and shifts. Consider the following modification of the main program from daily 3 #include void set flag(unsigned int flag holder, int flag position); void unset flag(unsigned intflag 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 argc, char* argv[]) unsigned int flag-holder = e; set flag(&flag holder, 3); set flag(&flag holder, 16); set flag(&flag holder, 31); display 32 flags(flag holder); unset flag(&flag holder, 31); unset-flag(&flag-holder, 3); set flag(&flag holder, 9) display 32 flags (flag holder); return Write the code for the definition of unset flag and display_32 flags so that the output of your program looks like the following 08 e ress any ey to CO You can think of the unset flag function as taking an integer and making sure that the nh bit is a 0. You may find the operator useful. It is used to "flip the bits" of a number making all the zero values 1's and all the I's zeroes. As in the previous daily, the shifting operators and the bitwise and (&) and or () may also 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 screen as was given in the previous assignment Gust turn it into a function instead). This daily will allow you to practice more with the bit wise operators and shifts. Consider the following modification of the main program from daily 3 #include void set flag(unsigned int flag holder, int flag position); void unset flag(unsigned intflag 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 argc, char* argv[]) unsigned int flag-holder = e; set flag(&flag holder, 3); set flag(&flag holder, 16); set flag(&flag holder, 31); display 32 flags(flag holder); unset flag(&flag holder, 31); unset-flag(&flag-holder, 3); set flag(&flag holder, 9) display 32 flags (flag holder); return Write the code for the definition of unset flag and display_32 flags so that the output of your program looks like the following 08 e ress any ey to CO You can think of the unset flag function as taking an integer and making sure that the nh bit is a 0. You may find the operator useful. It is used to "flip the bits" of a number making all the zero values 1's and all the I's zeroes. As in the previous daily, the shifting operators and the bitwise and (&) and or () may also 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 screen as was given in the previous assignment Gust turn it into a function instead)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

Q.No.1 Explain Large scale map ? Q.No.2 Explain small scale map ?

Answered: 1 week ago

Question

1. Signs and symbols of the map Briefly by box ?

Answered: 1 week ago

Question

Types of physical Maps?

Answered: 1 week ago