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
How pointers are declared?
Which header file is used for clrscr?
using only #include
Can math operations be performed on a void pointer?
What is the symbol indicated the c-preprocessor?
Is int a keyword in c?
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
Why can arithmetic operations not be performed on void pointers?
What is context in c?
How does free() know explain how much memory to release?
in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures
What are the keywords in c?
What is %d called in c?
What are the 5 organizational structures?
What is the use of extern in c?