The return statement is associated with procedures (methods or functions). On executing the return statement, the system passes the control from the called procedure to the calling procedure. This return statement is used for two purposes :
- to return immediately to the caller of the currently executed code
- to return some value to the caller of the currently executed code.