It is easier to write an incorrect program than understand a correct one.
int countBits(int i){ int count = 0; while (i>0){ count += (i & 0x01); i>>1;}return count;}
No comments:
Post a Comment