write a program to find out number of on bits in a number?
Answer Posted / jaya j
unsigned int count1s(unsigned char x)
{
int p;
for(p=0;x!=0;x>>=1)
if(x&1)
p++;
return p;
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Write a program to print "hello world" without using a semicolon?
How would you rename a function in C?
Explain how can I make sure that my program is the only one accessing a file?
What is identifiers in c with examples?
When should a type cast not be used?
How can you access memory located at a certain address?
Tell us something about keyword 'auto'.
What are structures and unions? State differencves between them.
Create a simple code fragment that will swap the values of two variables num1 and num2.
What are the rules for identifiers in c?
Describe the order of precedence with regards to operators in C.
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
Is python a c language?
Is there a way to switch on strings?
How important is structure in life?