Answers for "count number of bits set in a number"

0

count number of bits set in a number

int count_one (int n)
        {
            while( n )
            {
            n = n&(n-1);
               count++;
            }
            return count;
    }
Posted by: Guest on August-13-2021

Code answers related to "count number of bits set in a number"

Browse Popular Code Answers by Language