ProgrammingHard
How many integers in the range 0 to 255 have both bit 7 and bit 0 set?
- A. 32
- B. 64
- C. 128
- D. 127
Correct answer: B. 64
Bit 7 and bit 0 are fixed to 1, and the other six bits are free, which gives 2^6 = 64 values.
More C Programming questions
- 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);?
- What value is -x when x is 7 in two's complement, expressed as ~x + 1?