<prompt> Andika kazi ya C ambayo inachukua uwakilishi wa binary wa integer isiyo na ishara na inarudi idadi ya bits 1 ambayo ina pia inajulikana kama uzito wa Hamming.  <response>: Heres the C function you can use:int countOnesunsigned int n int count 0; while n count n 1; n 1; return count;In this function, we create a counter variable called count and initialize it to zero. Then we use a while loop that iterates until n is equal to zero. Inside the loop, we check whether the rightmost bit of n is equal to 1 using the bitwise AND operator with 1. If the result is not zero, we increment the count variable. We shift n to the right by 1 bit using the right shift operator to discard the rightmost bit and continue the loop. Finally, we return the count variable once the loop is finished. 