Hacking the program for counting bits set

$gcc counting-bits-set-naive-way-related.c
$./a.out
Enter v 8474578
Total bits set in v is 11
$./a.out
Enter v 1
Total bits set in v is 1
$./a.out
Enter v 2
Total bits set in v is 1
$./a.out 3
Enter v a
Total bits set in v is 0
$cat counting-bits-set-naive-way-related.c
#include <stdio.h>

int main()
{
unsigned int v; /* count the number of bits set in v */
unsigned int c; /* c accumulates the total bits set in v */

printf("Enter v ");
scanf("%u",&v);
for(c = 0; v ; v >>= 1)
{
c = c + (v & 1);
}

printf("Total bits set in v is %u \n",c);
return 0;
}
$