ProgrammingVery hardGATE CS · Campus placements

For 4-bit masks (bits 0 to 3), how many masks have both bit 0 and bit 2 set?

  1. A. 2
  2. B. 6
  3. C. 4
  4. D. 8

Correct answer: C. 4

Bits 0 and 2 are fixed to 1, and bits 1 and 3 are free, giving 2 * 2 = 4 masks.

More C Programming questions

Exams that ask this topic