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
What are header files in c?
Explain that why C is procedural?
What is s in c?
Why dont c comments nest?
how to write a c program to print list of fruits in alpabetical order?
How do you view the path?
Explain modulus operator. What are the restrictions of a modulus operator?
What is the difference between functions getch() and getche()?
Place the #include statement must be written in the program?
What is type qualifiers?
Why is c not oop?
Why does the call char scanf work?
How can I manipulate strings of multibyte characters?
List some of the static data structures in C?
What are called c variables?