Question: Please write a C program and meet the following requirements. code is an input number o Invoke the function display_binary () to display the o
o Invoke the function display_binary () to display the o Declare a mask for unit number - the lowest 3 bits in . Use this mask and bitwise & to retrieve the unit code in binary the code. number - store it in a variable. Display the unit number to the screen. Declare a mask to retrieve the signal (the 7th bit) . Use thismask and bitwise & to retrieve the signal - Display the outcome to the screen. o Declare a mask to retrieve the number of tanks. . Use the mask, bitwise & and then >> to retrieve the number of tanks. Display it to the screen. o Declare a mask to change the safety signal, bit 7, to 0 and leave all the other bits in the code the same. Use this mask and bitwise to change the code. . Display the changed code in decimal and binary
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
