i have been reading K&R but in this code i totally got lost i understand it counts the 1 in the binary but what i dont understand that how it does so because K&R didnt really explain it would be awesome if someone explained to me how it counts the 1z
Code:
/* bitcount: count 1 bits in x */
int bitcount(unsigned x)
{
int b;
for (b = 0; x != 0; x >>= 1)
if (x & 01)
b++;
return b;
}