Give a method to count the number of ones in a 32 bit number?
Answer Posted / ataraxic
int i = 0;
while (x) {
x &= x-1;
++i;
};
printf("number of ones is %d\n", i);
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
what is a function method?give example?
Explain union.
What is getch () for?
What are the advantages of external class?
Why do we use c for the speed of light?
How many parameters should a function have?
Write a program to find the biggest number of three numbers in c?
Is it valid to address one element beyond the end of an array?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures
What is the significance of c program algorithms?
What is adt in c programming?
what is reason of your company position's in india no. 1.
Explain what is gets() function?
How can I read/write structures from/to data files?
in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above