Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)
main() { int i=1177; int j=0; while(i>0) { if((i%2)!=0) j++; i=i/2; } printf("The number of one is %d\n", j); }