ProgrammingHardGATE CS · Campus placements

uint32_t x = 491u; What is (x >> 3) & 7? (491 is 0x1EB.)

  1. A. 3
  2. B. 7
  3. C. 5
  4. D. 6

Correct answer: C. 5

Shifting right by 3 gives 61, which is 111101 in binary. Masking with 7 keeps the lowest three bits, 101, which is 5.

More C Programming questions

Exams that ask this topic