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 a floating point in c?
write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34
what is the role you expect in software industry?
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
What’s a signal? Explain what do I use signals for?
What is double pointer in c?
Apart from dennis ritchie who the other person who contributed in design of c language.
How can you convert integers to binary or hexadecimal?
What is difference between arrays and pointers?
Differentiate between null and void pointers.
Is there a way to switch on strings?
what is event driven software and what is procedural driven software?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
What is difference between union and structure in c?
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)