Answer & Solution
When a return statement is encountered in a function, it immediately exits the function and sends back the specified value to the caller. This allows the function to produce a result or output that can be used in other parts of the program. The returned value can be assigned to variables, used in expressions, or passed as arguments to other functions. The return statement is essential for functions to be able to provide results or perform computations that yield outputs.