ProgrammingHardTCS NQT · Infosys

The sorted array is {1, 3, 3, 3, 7, 9}. What is the index of the first element that is at least 4?

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

Correct answer: C. 4

Index 4 holds 7, the first value not less than 4. Indices 0 to 3 hold 1, 3, 3, 3, all smaller than 4.

More C Programming questions

Exams that ask this topic