Question: please answer the question and show the code and output. This should be done in C programming Flipping a bit Write a function that accepts
please answer the question and show the code and output. This should be done in C programming
Flipping a bit Write a function that accepts as input an unsigned char, and an integer bitNum (range 0-7) and using the shift and xor operators flips the bit. Namely, if the bit as position bitNum is 0 then it sets the bit at that position to 1 and if the bit at position bitNum is 1 then it sets the bit at that position to 0. The function returns modified character. For example, if the bit sequence of a char is 00010100 and bitNum == 4 then the answer should return 00000100. unsigned char flipBit(unsigned char c, int bitNum);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
