Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)

image text in transcribed

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

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

Students also viewed these Databases questions

Question

2. What is the role of the APOE gene in neurocognitive disorders?

Answered: 1 week ago

Question

7. Explain why retirees may be valuable as part-time employees.

Answered: 1 week ago

Question

3. Provide advice on how to help a plateaued employee.

Answered: 1 week ago