Pregunta de entrevista de Intel Corporation

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

Respuestas de entrevistas

Anónimo

1 jul 2012

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

Anónimo

12 jul 2011

use bit wise operators. && and shift operators.