Pergunta de entrevista da empresa Rockwell Automation

Count how many bits are turned on in an integer.