Machine-translated by Google. Questions are authored in English.
Top

Discussion

In a function two return statements should never occur.

  • A.Yes
  • B.No

Answer: B

Correct answer: No

Several return statements in one function are perfectly ordinary - one per branch is the common pattern, and it often reads better than forcing a single exit. What should not happen is two consecutive returns, since the second can never be reached.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.