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 are the difference between a free-standing and a hosted environment?

1284


Explain how do I determine whether a character is numeric, alphabetic, and so on?

1130


How can I call fortran?

1039


C program to find all possible outcomes of a dice?

2350


Is c high or low level?

1005


What is masking?

1151


What is 02d in c?

1071


Why do we use main function?

1173


How does free() know explain how much memory to release?

1052


What is the difference between single charater constant and string constant?

1083


What is the equivalent code of the following statement in WHILE LOOP format?

1297


HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????

2689


What is volatile variable in c?

1088


How can a program be made to print the line number where an error occurs?

1082


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

1151