What is the purpose of the return statement in a function?

2025

What is the purpose of the return statement in a function?

Answer: B. To stop function execution and optionally pass back a result

  1. A.

    To print values

  2. B.

    To stop function execution and optionally pass back a result

  3. C.

    To define a function

  4. D.

    To take input from the user

Attempted by 334 students.

Show answer & explanation

Correct answer: B

Explore the full course: Rssb Basic Computer Instructor

Loading lesson…