Let's take n = 17
$17_{10} = (10001)_{2}$
$count = 0$
$(0xf)_{16} = (15)_{10} =(1111)_{2} $
$for(n; n > 0; n>>4)$
$count = count + table[ 17 & 15 ] = count + table[1] = 0 + 1 = 1$
$n >> 4$ means right shift by 4 bits
$17 >> 4$ = 1
$count = count + table[1 & 15] = 1 + table[1] = 1 + 1 = 2$
$1 >> 4$ = 0 , loop will be terminated;
$count = 2$
Here we can see that there are 2 1's in the binary representation of $17$