unsigned int i;
for (i = 100; i < = 0; --i)
printf("%d\n",i);
it will never enter the for loopbit count problem (again... how many '1'?)
int bitcount (unsigned int n)
{
int count=0 ;
while (n)
{
count++ ;
n &= (n - 1) ;
}
return count ;
}
check the following link for this question:
No comments:
Post a Comment