ProgrammingHard

Records (name, score, age) are sorted by score descending, and by age ascending for equal scores. Input: (A,90,30), (B,90,25), (C,85,20). What is the output order?

  1. A. A, B, C
  2. B. B, A, C
  3. C. C, B, A
  4. D. B, C, A

Correct answer: B. B, A, C

B and A share score 90, so the younger B (age 25) comes first. C has the lowest score and comes last.

More C Programming questions

Exams that ask this topic