Pergunta de entrevista da empresa Intel Corporation

write a function to see how many bits are set in an integer.

Respostas da entrevista

Sigiloso

1 de jul. de 2012

while(n>0){ (n&(n-1)) count++; }

Sigiloso

12 de jul. de 2011

use bit wise operators. && and shift operators.