Written by the Fiveable Content Team • Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 exam•Written by the Fiveable Content Team • Last updated September 2025
Definition
A return statement is used in a function to specify the value that should be returned when the function is called. It allows the function to send a value back to the code that called it.
Related terms
Function: A function is a block of code that performs a specific task and can be reused throughout the program. It may use return statements to send values back to the calling code.
Parameter: A parameter is a variable defined in a function's declaration. It represents an input value that can be passed into the function when it is called.
Void: Void is used as the return type for functions that do not need to send any value back. These functions typically perform actions rather than returning data.