ProgrammingModerate
What is the number of trailing zero bits in 40 (binary 101000)?
- A. 2
- B. 4
- C. 3
- D. 5
Correct answer: C. 3
40 = 8 x 5, so the lowest set bit is bit 3 and there are three trailing zeros.
More C Programming questions
- 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?
- What is the value of (unsigned short)(65535 + 1) on a platform where unsigned short is 16 bits?