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 / minisha

int count(unsigned int n)
{
int c=0;
while(n)
{
n=n&(n-1);
c++
}
return c;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a floating point in c?

1126


write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34

2255


what is the role you expect in software industry?

2202


Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?

1167


What’s a signal? Explain what do I use signals for?

1158


What is double pointer in c?

1089


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

1478


How can you convert integers to binary or hexadecimal?

1075


What is difference between arrays and pointers?

1151


Differentiate between null and void pointers.

1231


Is there a way to switch on strings?

1131


what is event driven software and what is procedural driven software?

2623


write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);

2416


What is difference between union and structure in c?

1247


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2697