Pergunta de entrevista da empresa Qualcomm

Write a function that determines how many 1s are in an integer.