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
- A.
To print values
- B.
To stop function execution and optionally pass back a result
- C.
To define a function
- D.
To take input from the user
Attempted by 334 students.
Show answer & explanation
Correct answer: B
Loading lesson…