#include #define CODD(x,c)\ { \ for(c=0; x>0; x=x>>2){\ c += x&1;\ }\ } int main(){ int b = 111111, c; /* 1011 */ CODD(b,c); printf("%d\n",c); return 0; } /* 32 16 8 4 2 1 1 1 * 1 * 1 == 53 */