how abt my code
#include<stdio.h>
int count1bitsn(int n)
{
int count=0;
while(n)
{
count+=n&1;
n=n>>1;
}
return count;
}
int main()
{
int n;
printf("Enter the value of n\n");
scanf("%d",&n);
printf("Answer=%d\n",count1bitsofn(n));
}
On Mar 22, 12:39 am, "Karthik Singaram L" <[EMAIL PROTECTED]>
wrote:
> The standard linkhttp://graphics.stanford.edu/~seander/bithacks.html
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---