ProgrammingHard
What is the value of x & (x - 1) for x = 0b10110100 in binary as a decimal?
- A. 176
- B. 180
- C. 132
- D. 128
Correct answer: A. 176
The expression clears the lowest set bit, bit 2, leaving 0b10110000 = 176.
More C Programming questions
- How many integers in the range 0 to 255 have both bit 7 and bit 0 set?
- What is the number of trailing zero bits in 40 (binary 101000)?
- What is -7 / 4 in C?
- unsigned char c = 0xF0; c |= 0x0F; c <<= 1; printf("%d", c); What is printed?
- What is the value of 1u << 31 >> 31 in C?
- What is printed by printf("%d", 0x7FFFFFFF + 0);?