write a program to find out number of on bits in a number?
Answer Posted / rajkumar
#include<stdio.h>
void main()
{
int a,count=0;
while(a>0)
{
if(a%2==1)
count++;
a=a>>1;
}
printf("no of on bits =%d ",count);
}
| Is This Answer Correct ? | 15 Yes | 1 No |
Post New Answer View All Answers
How can I use a preprocessorif expression to ?
What is #include stdlib h?
What is the difference between memcpy and memmove?
Why c is procedure oriented?
What is file in c preprocessor?
cavium networks written test pattern ..
which type of aspect you want from the student.
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
Explain 'far' and 'near' pointers in c.
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above
Do you have any idea how to compare array with pointer in c?
What language is windows 1.0 written?
Write the syntax and purpose of a switch statement in C.
Find MAXIMUM of three distinct integers using a single C statement
Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff