find count of 1, completed!!!

while (n)
{
n &= (n-1);
ncount++;
}