// Use a negation to create a useful mask to unset a bit #include int main(void){ // X unsigned char x = 7; //0000 0111 //1111 1101 & //---------- //0000 0101 printf("Number is %u\n",x); //First way unsigned int mask1 = 0xFD; unsigned int result = x & mask1; printf("%u\n",result); //Second way //0000 0111 unsigned int mask2 = 2; result = x & ~mask2; printf("%u\n",result); return 0; }