What does the following function do: unsigned int doit(int x) { unsigned int z = 0; while (x &= (x-1)) z++; return z; }
Sigiloso
This is the question with the unintentional bug in it. I ran through it 4 times and kept getting non-sensical answers. It was supposed to count the number of enabled bits in x, but it is off by one.