This tool is donation based and free. 🙏 We're looking for donations to keep it running — $360/year covers our server costs.

$18 of $360 · 5%
Donate
This fact check is over 3 months old. The situation may have changed significantly — please recheck before relying on it.

Return Statement: Accurate Description in Programming

“In programming, return gets the answer (the result of a calculation or process) and hands it back to the specific part of the code that requested it.”
Accurate description
Confidence: High Checked on May 10, 2026

Summary

The return statement terminates a function’s execution and optionally supplies a value to the caller, thereby delivering the result of a calculation or process back to the part of the code that invoked the function. This behavior is consistent across major programming languages.

Recheck this fact Runs a fresh check with up-to-date sources

Sources 59 searched

learn.microsoft.com
en.wikipedia.org
  • Return statement - Wikipedia

    In computer programming, a return statement causes execution to leave the current subroutine and resume at the point in the code immediately after the instruction which called the subroutine, known as its return address. The return address is saved by the calling routine, today usually on the ...

  • Return type - Wikipedia

    Various mechanisms are used for the case where a subroutine does not return any value, e.g., a return type of ... A method returns to the code that invoked it when it completes all the statements in the method, reaches a return statement, or throws an exception, whichever occurs first.

geeksforgeeks.org
  • Return Statement in C - GeeksforGeeks

    C return statement is used to end the execution of a function and return a value. It also passes the control back to the function from which it was called. The return statement may or may not return a value depending on the function's return type.

mimo.org
  • Return Statement: Definition, Purpose, and Examples

    Even functions that don’t explicitly return anything use a return statement behind the scenes — they simply return a default value like None (Python), undefined (JavaScript), or Void (Swift). Every programming language uses a return statement to exit a function and optionally send back a value.

developer.mozilla.org
lenovo.com
  • How Return Statements Enhance Your Code Efficiency | Lenovo US

    It involves specifying "return" followed by the desired value or expression to be sent back. For instance, to return the number 10, the syntax would be "return 10". Subsequently, Python transmits this value to the point in the code where the function was invoked.

softwareengineering.stackexchange.com
stackoverflow.com
  • language agnostic - Should a function have only one return statement? - Stack Overflow

    Huge block of if-else statements, each with a return? That is nothing. Such a thing is usually easily refactored. (atleast the more common single exit variation with a result variable is, so I doubt the multi exit variation would be any more difficult.) If you want a real headache, look at a combination of if-else and while loops (controlled by local booleans), where result variables are set, leading to a final exit point at the end of the method.

This fact check is free and donation-based. $1 powers ~30 fact-checks.

Donate $1 to support fact-checking

Check another fact