MCQs > IT & Programming > C Programming > Following function do? int fn(unsigned int x) { int count = 0; for(; x!=0; x&=(x-1)) count++; return count; }

C Programming MCQs

What does the following function do?
int fn(unsigned int x)
{
int count = 0;
for(; x!=0; x&=(x-1))
count++;
return count;
}

Answer

Correct Answer: Returns the minimum number of bits required to represent the number x

Explanation:

Note: This Question is unanswered, help us to find answer for this one

C Programming Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

C Programming Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it