write a program to find out number of on bits in a number?
Answer Posted / anilkumar
int n ; \\any number
for(count=0;n&=(n-1); count++);
printf("%d", count);
| Is This Answer Correct ? | 11 Yes | 4 No |
Post New Answer View All Answers
What are the difference between a free-standing and a hosted environment?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
How can I call fortran?
C program to find all possible outcomes of a dice?
Is c high or low level?
What is masking?
What is 02d in c?
Why do we use main function?
How does free() know explain how much memory to release?
What is the difference between single charater constant and string constant?
What is the equivalent code of the following statement in WHILE LOOP format?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
What is volatile variable in c?
How can a program be made to print the line number where an error occurs?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }