Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Write a program to model an exploding firecracker in the xy plane using a particle system

4095


Write a routine to implement the polymarker function

4840


write a simple calculator c program to perform addition, subtraction, mul and div.

3678


Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines

3476


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 ??

2427


write a program for area of circumference of shapes

2509


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']

945


Sir... please give some important coding questions asked by product companies..

2212


What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?

4443


Design an implement of the inputs functions for event mode

3455


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.

2619


Cluster head selection in Wireless Sensor Network using C programming language.

3677


why nlogn is the lower limit of any sort algorithm?

2789


How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

2493


Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?

4343