Frage im Vorstellungsgespräch bei Valeo

write an algorithm to count binary numbers in a byte.

Antwort im Vorstellungsgespräch

Anonym

12. Dez. 2015

int n=65045454; int count = 0; while (n > 0){ count ++; n = n & (n-1); } printf("%d\n",count);

3