1 int func(int x){ 2 int countx = 0; 3 while(x){ 4 countx ++; 5 x = x & (x-1); 6 } 7 return countx; 8 }