Count number of bits in an unsigned integer
问题 I want to write a function named bitCount() in the file: bitcount.c that returns the number of bits in the binary representation of its unsigned integer argument. Here is what I have so far: #include <stdio.h> int bitCount (unsigned int n); int main () { printf ("# 1-bits in base 2 representation of %u = %d, should be 0\n", 0, bitCount (0)); printf ("# 1-bits in base 2 representation of %u = %d, should be 1\n", 1, bitCount (1)); printf ("# 1-bits in base 2 representation of %u = %d, should be