What is the primary purpose of the return statement in C++ functions? 

  • To loop the function 
  • To display a value 
  • To exit the function 
  • To allocate memory
In C++, the return statement is primarily used to conclude the execution of a function and provide a value back to the caller. It signifies the end of a function's execution and optionally returns a value to the calling function.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *