Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int fun(int x);
- int main(void){
- printf("%d",fun(456));
- }
- int fun(int x)
- {
- int count = 0 ;
- while(x){
- count++ ;
- x = x & (x-1) ;
- printf("x=%d,count=%d\n",x,count);
- }
- return count ;
- }
Add Comment
Please, Sign In to add comment