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

A Returns the value and continues executing rest of the statements, if any
B Returns the value and stops the program
C Returns the value and stops executing the function
D Stops executing the function and returns the value

Correct Answer: Stops executing the function and returns the value

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.

Related Questions

A model which regresses return of stock against return of market is classified as
What will the function session_id() return is no parameter is passed?

Next steps