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

hi, which software companys will take,if d candidate's % is jst 55%?

2093


How can a string be converted to a number?

1023


What is c system32 taskhostw exe?

1032


How a string is stored in c?

1076


What are the different properties of variable number of arguments?

1166


What is use of integral promotions in c?

1152


what is the height of tree if leaf node is at level 3. please explain

2153


to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?

2184


any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above

1143


Write a program to swap two numbers without using third variable?

1316


Explain spaghetti programming?

1267


Can you please explain the difference between syntax vs logical error?

1199


What is use of null pointer in c?

1017


What does the && operator do in a program code?

1243


How can I dynamically allocate arrays?

1106