Google Interview Question

write a program to count the number of 1 digits in a number's binary representation.