Aliensbrain
  • Home
  • Topics
  • Quizzes
  • Notebooks
  • Community
  • Sign in
  • programming languages Online Quiz - 17
  • The following code will generate a compiler error. <pr...

The following code will generate a compiler error.

string GetAgePhrase(int age) {
    if (age > 60) return "Senior";
    if (age > 40) return "Middle-aged";
    if (age > 20) return "Adult";
    if (age > 12) return "Teen-aged";
    if (age > 4) return "Toddler";
}

Which of the following statements, inserted as the last line of the function, would solve the problem?

technology programming languages
  1. a. continue;

  2. b. break;

  3. c. return "Infant";

  4. d. return 0;


Show answer
Correct Option: C

Find more quizzes:

© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy