ProgrammingVery hardGATE CS · Campus placements

How many 6-bit masks have exactly two 1 bits and have bit 0 cleared?

  1. A. 15
  2. B. 6
  3. C. 10
  4. D. 20

Correct answer: C. 10

Bit 0 is fixed at 0, so the two set bits are chosen from bits 1 to 5, which is C(5,2) = 10.

More C Programming questions

Exams that ask this topic