Question: C PROGRAMMING HW. 1 Program must take a short integer (16-bit) from the user and write the corresponding binary number into char array by using

C PROGRAMMING HW.

1 Program must take a short integer (16-bit) from the user and write the corresponding binary number into char array by using the bit shift operations. Write the function that displays the bits as characters. You can use this prototype: void DisplayBitsAsCharacters(unsigned char Bits [], unsigned short message) Input number must be unsigned short. It means that the maximum input number is 65,535. The program must display the minimum number of digits. For example; 16-bit short integer Message1 = 127 and 16-bit binary equivalent is 0000000001111111. The program must discard the zeros which are unnecessary to express the message number and display it as 1111111. Print the Number of Digits 2 Write the function that uses the char Bits array which is generated at the function of "DisplayBitsAsCharacters, as an input argument and convert this binary number into an unsigned short integer. As a result, the program should give the same number which is entered by the user. You can use this prototype: unsigned short ConvertToDecimal(char Bits, int numberofbinarydigits)

C PROGRAMMING HW. 1 Program must take a short integer (16-bit) from

Enter 16-bit Message-1: 127 1111111 = 127 Number of Digits: 7 Enter 16-bit Message-2: 1200 = 10010110000 1200 Number of Digits: 11 Enter 16-bit Message-3: 15345 11101111110001 15345 Number of Digits: 14 Enter 16-bit Message-4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!