Question: Give a command that completes the function below. // Sets the value (1/0) of bits 4 and 5 in the char b to the values
Give a command that completes the function below.
// Sets the value (1/0) of bits 4 and 5 in the char b to the values // four and five respectively. Assume four and five are either 0 or 1. char SetBits45(unsigned char b, char four, char five) { return __________; }
Tips: Do not use spaces. Remember that we number the bits from the right starting at 0. The expected answer uses one hex constant (other constants should be in decimal) and fits the form "(b...)|(four...)|(five...)".

Question 2 Set Bits Give a command that completes the function below. // Sets the value (1/0) of bits 4 and 5 in the char b to the values // four and five respectively. Assume four and five are either oor 1. char SetBits45 (unsigned char b, char four, char five) { return } Tips: Do not use spaces. Remember that we number the bits from the right starting at 0. The expected answer uses one hex constant (other constants should be in decimal) and fits the form " (b...)|(four...)|(five...)". (b&0x180] (four
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
