Question: please write in C. Second: Bit Count functions (35 points) In this part, you have to determine the parity of a number and the amount

please write in C. please write in C. Second: Bit Count functions (35 points) In

Second: Bit Count functions (35 points) In this part, you have to determine the parity of a number and the amount of 1-bit pairs present in the number. Parity refers to whether a number contains an even or odd number of 1-bits. 1-bit pairs are defined by 2 adjacent 1's without overlap with other pairs. For example the number 3 has the binary sequence 111 and is considered to contain 1 pair while the sequence 101101111 has 3 pairs. Input format: This program takes a single number as an argument from the command line. This number should be considered as an unsigned short. Output format: Your program should print either "Even-Parity" if the input has an even amount of 1 bits and "Odd-Parity" otherwise, followed by a tab. Your program should then print the number of 1-bit pairs present in the number followed by a new line character. Example Executio Some sample runs and results are: $./second 12 Even-Parity $./second 31 Odd-Parity 2

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!