Q. 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
πŸ’¬ Discuss
βœ… Correct Answer: (D) Stops executing the function and returns the value
Explanation: The return statement causes the function to stop executing and to return the value of its expression (if any) to the caller.
Explanation by: Mr. Dubey
The return statement causes the function to stop executing and to return the value of its expression (if any) to the caller.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
135
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
83%
Success Rate