ProgrammingHard

Records (P,5), (Q,9), (R,9), (S,3) are scanned with if (s.score >= best.score) best = s; starting from the first record. Which name is kept?

  1. A. Q
  2. B. P
  3. C. R
  4. D. S

Correct answer: C. R

The >= test replaces the best on ties, so the last record with the maximum score wins. R is the last 9.

More C Programming questions

Exams that ask this topic