Amazon interview question

Write a program to count the bits in an int.