-
What is the purpose of a return statement in a function?
-
- Stops executing the function and returns the value
- Returns the value and stops executing the function
- Returns the value and stops the program
- Returns the value and continues executing rest of the statements, if any
- None of these
Correct Option: A
The return stops the execution of the function when it is encountered within the function.It returns the value to the statement where the function is called.