Return Statement

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/6

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

7 Terms

1
New cards

return;

A return form that exits the function without returning a value (used in void functions).

2
New cards

return some_expression_or_value;

A return form that exits the function and returns a value produced by an expression or literal.

3
New cards

It returns control (and possibly a value) to the caller—more precisely to the function call expression.

What return Actually Returns To?

4
New cards

Return Terminates the Function

Once a return statement executes, the function exits immediately.

5
New cards

Code After return Is Not Executed

Any statements written after a return statement in the same execution path will never run.

6
New cards

Multiple Return Statements

A function may contain more than one return statement, and whichever is reached first returns control/value immediately.

7
New cards

Conditional Returns

Return statements can be selected by conditions (e.g., returning 1, -1, or 0 depending on input).