The return keyword exits the function and sends a value back. Write return expression; where the expression matches the return type. For int functions, return an integer. For void, use return; to exit early.
Example: int square(int n) { return n * n; }. Calling square(4) calculates 4 * 4, returns 16. If you wrote int result = square(4);, result gets 16. Once return runs, the function stops.
Code after return is ignored. This lets you exit early when you have an answer or hit an error.