---
title: "Return Value — AP CSP Definition & Exam Guide"
description: "A return value is the value a procedure sends back to where it was called, via a RETURN statement. Key to Topic 3.12 and tracing procedure calls on the AP CSP exam."
canonical: "https://fiveable.me/ap-comp-sci-p/key-terms/return-value"
type: "key-term"
subject: "AP Computer Science Principles"
unit: "Unit 3"
---

# Return Value — AP CSP Definition & Exam Guide

## Definition

In AP Computer Science Principles, a return value is the value a procedure sends back to the point where it was called, specified by a RETURN statement. Execution of the procedure stops at RETURN, and the value can be stored in a variable, like result ← calculateSum(a, b).

## What It Is

A return value is what a [procedure](/ap-comp-sci-p/key-terms/procedure "fv-autolink") hands back when it finishes. In AP CSP pseudocode, the [RETURN statement](/ap-comp-sci-p/unit-3/developing-procedures/study-guide/Jhzac68HzbAilXRPuZFJ "fv-autolink") does two jobs at once. It immediately ends the procedure, and it sends a value back to the exact spot where the procedure was called. That spot is usually an assignment statement, so `total ← calculateTotal(price, quantity, taxRate)` means "run the procedure, then drop whatever it returns into `total`."

Think of a procedure call like sending someone to the store. Parameters are the shopping [list](/ap-comp-sci-p/unit-3/data-abstraction/study-guide/kMMTClSiHohfiaHMGFFE "fv-autolink") you hand them, and the return value is the bag of groceries they bring back. Per EK AAP-3.A.1, a procedure is a named group of instructions that may have parameters and return values, and per EK AAP-3.A.4, a procedure call interrupts the sequential execution of the program. The program jumps into the procedure, runs until it hits RETURN (or the last statement), then picks up right where it left off, now holding the returned value.

## Why It Matters

Return values live in **Topic 3.12 (Calling Procedures)** in [Unit 3](/ap-comp-sci-p/unit-3 "fv-autolink"): Algorithms and Programming, supporting learning objective **[AP Comp Sci P](/ap-comp-sci-p "fv-autolink") 3.12.A**, which asks you to write statements that call procedures and determine the result or effect of a procedure call. You can't do either without understanding what a procedure gives back. Return values are also the glue that makes procedural abstraction work. A procedure that returns a value can be reused anywhere, because callers only care about what comes out, not how it was computed. That input-process-output pattern (parameters in, return value out) is one of the most heavily tested ideas in all of Unit 3.

## Connections

### [Parameters (Unit 3)](/ap-comp-sci-p/key-terms/parameters)

[Parameters](/ap-comp-sci-p/key-terms/parameters "fv-autolink") and return values are the two ends of the same pipe. Parameters are the inputs a procedure receives (EK AAP-3.A.3), and the return value is the output it produces. A question like the calculateTotal example tests whether you can tell them apart, since price, quantity, and taxRate go in, and subtotal + tax comes out.

### [Flow of control (Unit 3)](/ap-comp-sci-p/key-terms/flow-of-control)

A RETURN statement is a flow-of-control move. Per EK AAP-3.A.4, calling a procedure interrupts [sequential execution](/ap-comp-sci-p/unit-3/calling-procedures/study-guide/lwdr3yhVOtUJZhAmJ5cu "fv-autolink"), and RETURN is what sends execution (plus the value) back to the call site. If a RETURN sits inside a loop or IF block, hitting it exits the whole procedure right there, which is a favorite trap in code-tracing questions.

### Variables and assignment (Unit 3)

A return value vanishes unless you capture it. The standard pattern is an assignment statement like `result ← calculateSum(a, b)`, where the [procedure call](/ap-comp-sci-p/key-terms/procedure-call "fv-autolink") sits on the right side and its return value flows into the variable on the left. Multiple-choice questions love checking whether you know that exact syntax.

## On the AP Exam

Return values show up in multiple-choice questions in two main flavors. First, syntax questions ask which statement correctly captures a return value, and the answer is almost always an assignment like `finalAmount ← calculateTotal(...)` or `result ← calculateSum(a, b)`, with the call on the right side of the arrow. Second, code-tracing questions give you a procedure like `findMax(list)` and ask what it returns for a given input, which means walking through the loop and tracking the variable that gets returned. You may also see questions asking you to identify which names are parameters versus what the return value is in a procedure definition. The skill being tested is always AP Comp Sci P 3.12.A, determining the result or effect of a procedure call.

## return value vs Displayed output (DISPLAY)

RETURN sends a value back to the program so it can be stored in a variable or used in an expression. DISPLAY just shows a value to the user and gives nothing back to the code. A procedure that displays a sum but never returns it leaves the calling program empty-handed, so `result ← showSum(a, b)` would not store the sum. On trace questions, ask yourself whether the value goes back into the program (RETURN) or out to the screen (DISPLAY).

## Key Takeaways

- A return value is the value a procedure sends back to the point where it was called, specified by a RETURN statement (EK AAP-3.A.1).
- RETURN immediately ends the procedure, so any statements after a RETURN that executes will never run.
- To capture a return value, put the procedure call on the right side of an assignment, like result ← calculateSum(a, b).
- Parameters are the inputs to a procedure, and the return value is its output, so don't mix up which is which in a procedure definition.
- RETURN gives a value back to the program, while DISPLAY only shows it to the user, and the exam tests that difference often.
- A procedure call interrupts sequential execution, runs the procedure's statements, then resumes at the call site with the returned value (EK AAP-3.A.4).

## FAQs

### What is a return value in AP Computer Science Principles?

It's the value a procedure hands back to the point where it was called, written with a RETURN statement in AP pseudocode. For example, RETURN subtotal + tax sends that computed total back to whatever line called the procedure.

### Is RETURN the same as DISPLAY in AP CSP?

No. RETURN sends a value back into the program so it can be stored or used in another expression, while DISPLAY only shows the value to the user. A procedure that displays a result but doesn't return it gives the calling code nothing to work with.

### What's the difference between a parameter and a return value?

Parameters are the input variables a procedure receives when it's called (their values come from the arguments), and the return value is the single output the procedure sends back. In calculateTotal(price, quantity, taxRate), the three names in parentheses are parameters, and subtotal + tax is the return value.

### How do you store the return value of a procedure in a variable?

Use an assignment statement with the procedure call on the right side, like finalAmount ← calculateTotal(price, quantity, taxRate). The procedure runs first, then its return value gets assigned to the variable.

### Does every procedure have to return a value on the AP CSP exam?

No. EK AAP-3.A.1 says procedures may have parameters and return values, so some procedures just perform an action (like displaying something) without returning anything. Execution still resumes after the call either way.

## Related Study Guides

- [3.12 Calling Procedures](/ap-comp-sci-p/unit-3/calling-procedures/study-guide/lwdr3yhVOtUJZhAmJ5cu)

## Structured Data

```json
{"@context":"https://schema.org","@graph":[{"@type":"LearningResource","@id":"https://fiveable.me/ap-comp-sci-p/key-terms/return-value#resource","name":"Return Value — AP CSP Definition & Exam Guide","url":"https://fiveable.me/ap-comp-sci-p/key-terms/return-value","learningResourceType":"Concept explainer","educationalLevel":"AP® / High School","about":{"@id":"https://fiveable.me/ap-comp-sci-p/key-terms/return-value#term"},"audience":{"@type":"EducationalAudience","educationalRole":"student"},"dateModified":"2026-06-11T05:53:25.114Z","isPartOf":{"@type":"Collection","name":"AP Computer Science Principles Key Terms","url":"https://fiveable.me/ap-comp-sci-p/key-terms"},"publisher":{"@type":"Organization","name":"Fiveable","url":"https://fiveable.me"}},{"@type":"DefinedTerm","@id":"https://fiveable.me/ap-comp-sci-p/key-terms/return-value#term","name":"return value","description":"In AP Computer Science Principles, a return value is the value a procedure sends back to the point where it was called, specified by a RETURN statement. Execution of the procedure stops at RETURN, and the value can be stored in a variable, like result ← calculateSum(a, b).","url":"https://fiveable.me/ap-comp-sci-p/key-terms/return-value","inDefinedTermSet":{"@type":"DefinedTermSet","name":"AP Computer Science Principles Key Terms","url":"https://fiveable.me/ap-comp-sci-p/key-terms"}},{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What is a return value in AP Computer Science Principles?","acceptedAnswer":{"@type":"Answer","text":"It's the value a procedure hands back to the point where it was called, written with a RETURN statement in AP pseudocode. For example, RETURN subtotal + tax sends that computed total back to whatever line called the procedure."}},{"@type":"Question","name":"Is RETURN the same as DISPLAY in AP CSP?","acceptedAnswer":{"@type":"Answer","text":"No. RETURN sends a value back into the program so it can be stored or used in another expression, while DISPLAY only shows the value to the user. A procedure that displays a result but doesn't return it gives the calling code nothing to work with."}},{"@type":"Question","name":"What's the difference between a parameter and a return value?","acceptedAnswer":{"@type":"Answer","text":"Parameters are the input variables a procedure receives when it's called (their values come from the arguments), and the return value is the single output the procedure sends back. In calculateTotal(price, quantity, taxRate), the three names in parentheses are parameters, and subtotal + tax is the return value."}},{"@type":"Question","name":"How do you store the return value of a procedure in a variable?","acceptedAnswer":{"@type":"Answer","text":"Use an assignment statement with the procedure call on the right side, like finalAmount ← calculateTotal(price, quantity, taxRate). The procedure runs first, then its return value gets assigned to the variable."}},{"@type":"Question","name":"Does every procedure have to return a value on the AP CSP exam?","acceptedAnswer":{"@type":"Answer","text":"No. EK AAP-3.A.1 says procedures may have parameters and return values, so some procedures just perform an action (like displaying something) without returning anything. Execution still resumes after the call either way."}}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"AP Computer Science Principles","item":"https://fiveable.me/ap-comp-sci-p"},{"@type":"ListItem","position":2,"name":"Key Terms","item":"https://fiveable.me/ap-comp-sci-p/key-terms"},{"@type":"ListItem","position":3,"name":"Unit 3","item":"https://fiveable.me/ap-comp-sci-p/unit-3"},{"@type":"ListItem","position":4,"name":"return value"}]}]}
```
