Question: Implement function count_bits(int value) that count the number of bits that are 1 in value, and prints out the sum in decimal. As an example,
Implement function count_bits(int value) that count the number of bits that are 1 in value, and prints out the sum in decimal. As an example, count_bits(0x9876) will print out 8, while count_bits(0x1234) will print out 5.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
