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 5 types of organizational structures?

1133


How is = symbol different from == symbol in c programming?

1105


how to write a c program to print list of fruits in alpabetical order?

2364


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

1237


Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff

3394


Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?

1214


By using C language input a date into it and if it is right?

1134


What are the different data types in C?

1249


What are extern variables in c?

1042


How many types of operators are there in c?

1088


Do you have any idea how to compare array with pointer in c?

1094


What does sizeof int return?

1135


What is pointer to pointer in c language?

1213


What is c preprocessor mean?

1373


Explain the use of function toupper() with and example code?

1172