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
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
What is function and its example?
What is the size of enum in bytes?
Can one function call another?
What is the benefit of using const for declaring constants?
Which driver is a pure java driver
What is difference between far and near pointers?
What do you know about the use of bit field?
What is the use of the function in c?
Explain how can you tell whether a program was compiled using c versus c++?
to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?
What is pointers in c?
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
What is malloc calloc and realloc in c?
What are linked lists in c?