write code to count the number of bits in a byte
Anonymous
use a bit mask (0x01) and btiwise & it with the number. Keep left shifting the bitmask 8 times and increment count each time the answer of the bitwise & is 1.
Check out your Company Bowl for anonymous work chats.