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

write a program to find out number of on bits in a number?

Answer Posted / anilkumar

int n ; \\any number
for(count=0;n&=(n-1); count++);
printf("%d", count);

Is This Answer Correct ?    11 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does it mean when a pointer is used in an if statement?

1073


hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell

2147


Which header file is essential for using strcmp function?

1435


What type is sizeof?

1010


What are terms in math?

993


What does main () mean in c?

1071


Write a program to check whether a number is prime or not using c?

1018


Difference between Shallow copy and Deep copy?

1978


how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

1757


Why do we use null pointer?

1013


What is conio h in c?

1011


Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58

1486


How main function is called in c?

1087


Apart from dennis ritchie who the other person who contributed in design of c language.

1339


C program to find all possible outcomes of a dice?

2296