What is the most efficient way to count the number of bits
which are set in a value?
Answer Posted / boomer
pseudo
int size is 32 bits...right?
for(i = 0 to 31)
{
count += (value & 1) //& = and oprator
shift left value
}
Is This Answer Correct ? | 6 Yes | 5 No |
Post New Answer View All Answers
Is a house a mass structure?
Why isnt there a numbered, multi-level break statement to break out
State the difference between realloc and free.
What functions are used in dynamic memory allocation in c?
What does double pointer mean in c?
What is the argument of a function in c?
What are control structures? What are the different types?
write a proram to reverse the string using switch case?
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
What is the difference between the expression “++a” and “a++”?
Why is void main used?
What is the difference between far and near in c?
What is static memory allocation?
What does typeof return in c?
What are the different types of linkage exist in c?