Give a very good method to count the number of ones in a 32
bit number.
(caution: looping through testing each bit is not a solution)
Answer Posted / xyz
main()
{
int i=1177;
int j=0;
while(i>0)
{
if((i%2)!=0)
j++;
i=i/2;
}
printf("The number of one is %d\n", j);
}
| Is This Answer Correct ? | 14 Yes | 6 No |
Post New Answer View All Answers
Write a program to model an exploding firecracker in the xy plane using a particle system
Write a routine to implement the polymarker function
write a simple calculator c program to perform addition, subtraction, mul and div.
Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines
Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??
write a program for area of circumference of shapes
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']
Sir... please give some important coding questions asked by product companies..
What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?
Design an implement of the inputs functions for event mode
how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.
Cluster head selection in Wireless Sensor Network using C programming language.
why nlogn is the lower limit of any sort algorithm?
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?