Computer PPSC
Which of the following function return statements is syntactically correct?
Show answer
Correct answer: B) return 12; exit
Among the choices, 'return 12; exit' begins with the correctly written lowercase return statement ending in a semicolon; the other options use incorrect capitalization, order or punctuation for a return statement.
Related facts:
In case-sensitive languages such as C and Java, 'return' must be lowercase.
A return statement normally ends with a semicolon in C-like languages.
Exam tip: Look for lowercase 'return' with a semicolon in syntax questions.
Explanation
Among the choices, 'return 12; exit' begins with the correctly written lowercase return statement ending in a semicolon; the other options use incorrect capitalization, order or punctuation for a return statement.
Related facts:
In case-sensitive languages such as C and Java, 'return' must be lowercase.
A return statement normally ends with a semicolon in C-like languages.
Exam tip: Look for lowercase 'return' with a semicolon in syntax questions.