write a program to find out number of on bits in a number?
Answer Posted / minisha
int count(unsigned int n)
{
int c=0;
while(n)
{
n=n&(n-1);
c++
}
return c;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
hi, which software companys will take,if d candidate's % is jst 55%?
How can a string be converted to a number?
What is c system32 taskhostw exe?
How a string is stored in c?
What are the different properties of variable number of arguments?
What is use of integral promotions in c?
what is the height of tree if leaf node is at level 3. please explain
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?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
Write a program to swap two numbers without using third variable?
Explain spaghetti programming?
Can you please explain the difference between syntax vs logical error?
What is use of null pointer in c?
What does the && operator do in a program code?
How can I dynamically allocate arrays?