unsigned int i,parity; parity = 0; for (i=0; i> i) & 0x01; // count the number of ones }