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
Why do we use static in c?
find the sum of two matrices and WAP for it.
Is c is a high level language?
Who developed c language?
Is null valid for pointers to functions?
What is the difference between void main and main in c?
What is #line in c?
c program to compute AREA under integral
What are the Advantages of using macro
How do you construct an increment statement or decrement statement in C?
What’s the special use of UNIONS?
Why is c platform dependent?
What is the difference between text files and binary files?
Explain #pragma statements.
What is const keyword in c?