Bit Manipulation Flashcards
1
Q
Count number of bits set
A
And a number with n-1 makes the rightmost 1 to 0. So in a loop do it ..assign the result to n untill n becomes 0. Increment counts every time
Count number of bits set
And a number with n-1 makes the rightmost 1 to 0. So in a loop do it ..assign the result to n untill n becomes 0. Increment counts every time