Pergunta de entrevista da empresa HCLTech

How can we count the number of set bits in an integer number?