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
What is identifier in c?
Explain the difference between null pointer and void pointer.
can we have joblib in a proc ?
How do you redirect a standard stream?
How does sizeof know array size?
What is const keyword in c?
If I have a char * variable pointing to the name of a function ..
Difference between macros and inline functions? Can a function be forced as inline?
how many key words availabel in c a) 28 b) 31 c) 32
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)
What is the use of static variable in c?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
How is a null pointer different from a dangling pointer?
Explain argument and its types.
What is a memory leak? How to avoid it?