---
title: "Flow of Control — AP CSP Definition & Exam Guide"
description: "Flow of control is the order a program executes statements. In AP CSP, procedure calls jump execution into the procedure, then return right after the call."
canonical: "https://fiveable.me/ap-comp-sci-p/key-terms/flow-of-control"
type: "key-term"
subject: "AP Computer Science Principles"
unit: "Unit 3"
---

# Flow of Control — AP CSP Definition & Exam Guide

## Definition

Flow of control is the order in which a program executes its statements. In AP Computer Science Principles, a procedure call interrupts normal top-to-bottom execution, runs the procedure's statements, and then returns control to the point immediately after the call (EK AAP-3.A.4).

## What It Is

Flow of control is just the [path](/ap-comp-sci-p/unit-4/internet/study-guide/HouTEH6ypgVs8tNInelL "fv-autolink") the computer takes through your code. By default, programs run sequentially, one statement after another, top to bottom. But a [procedure call](/ap-comp-sci-p/key-terms/procedure-call "fv-autolink") breaks that pattern. When the program hits a call like `displayBoard()`, it pauses where it is, jumps into the procedure, runs every statement inside it, and then comes back to the exact spot right after the call and keeps going. The CED spells this out in EK AAP-3.A.4: a procedure call interrupts sequential execution, the procedure runs, and then control returns.

Think of it like a bookmark. The program marks its place, goes off to do the procedure's job, then flips back to the bookmark. A `RETURN(expression)` statement can send control back early, before the last line of the procedure, and it hands a value back to wherever the call happened. That "where does execution go next?" question is the whole game when you trace code on the exam.

## Why It Matters

Flow of control lives 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 procedure calls and determine the result or effect of a call. You can't determine the effect of a call without tracking flow of control, because the answer depends on what runs inside the procedure and where execution lands afterward. It also ties directly to parameters and return values (EK AAP-3.A.1 through AAP-3.A.3). Arguments carry values into the procedure when control jumps in, and a return value rides back out when control jumps back. Almost every code-tracing question on the AP CSP multiple-choice exam is secretly a flow-of-control question.

## Connections

### Parameters and Arguments (Unit 3)

[Parameters](/ap-comp-sci-p/key-terms/parameters "fv-autolink") are the handoff that happens at the exact moment flow of control jumps into a procedure. The arguments in the call become the parameter values inside, so tracing flow of control means tracking what data travels with it.

### [Return Value (Unit 3)](/ap-comp-sci-p/key-terms/return-value)

A RETURN statement is flow of control in reverse. It immediately exits the [procedure](/ap-comp-sci-p/key-terms/procedure "fv-autolink"), sends a value back, and drops execution at the point right after the call. Nothing below the RETURN inside that procedure ever runs.

### Selection and Iteration (Unit 3)

IF statements and loops are the other ways a program breaks out of straight top-to-bottom execution. [Selection](/ap-comp-sci-p/key-terms/selection "fv-autolink") skips statements, iteration repeats them, and procedure calls jump elsewhere and come back. Together these three cover every flow-of-control move AP CSP tests.

### Developing Procedures and Abstraction (Unit 3)

[Procedural abstraction](/ap-comp-sci-p/key-terms/procedural-abstraction "fv-autolink") works because flow of control is predictable. You can call a procedure without reading its insides, trusting that execution will go in, do the job, and return to your line. That trust is what lets you manage complexity in big programs and in your Create Performance Task.

## On the AP Exam

Flow of control shows up in multiple-choice code-tracing questions where you predict what a program displays or what value a variable holds. Common question stems ask exactly what the practice questions ask, like what happens to the flow of control when a procedure is called, where control returns after the call, and what effect a `RETURN(expression)` statement has. Your job is to trace it step by step. Find the call, jump into the procedure, substitute the arguments for the parameters, execute until a RETURN or the last statement, then resume at the line right after the call. A classic trap answer assumes the program restarts from the top after a procedure finishes instead of picking up where it left off. Flow of control also matters for your Create Performance Task, since you must explain how your student-developed procedure works when it's called.

## flow of control vs Sequential execution

Sequential execution is the default flow of control, statements running in order, top to bottom. Flow of control is the bigger idea that includes sequencing plus all the ways code breaks the default, like procedure calls, RETURN statements, selection, and loops. On the exam, EK AAP-3.A.4 frames it this way exactly. A procedure call interrupts sequential execution, and control comes back after the call once the procedure finishes.

## Key Takeaways

- Flow of control is the order in which a program executes statements, and by default that order is sequential, top to bottom.
- A procedure call interrupts sequential execution, runs all the statements inside the procedure, then returns control to the point immediately after the call (EK AAP-3.A.4).
- A RETURN(expression) statement ends the procedure right there, even mid-procedure, and sends both control and a value back to where the call happened.
- When control enters a procedure, the arguments in the call become the values of the parameters inside it.
- Tracing flow of control is the core skill behind learning objective AP Comp Sci P 3.12.A, which asks you to determine the result or effect of a procedure call.
- After a procedure finishes, the program does not restart from the top; it continues from the line right after the call.

## FAQs

### What is flow of control in AP Computer Science Principles?

Flow of control is the order in which a program's statements execute. AP CSP focuses on how a procedure call interrupts normal sequential execution, runs the procedure, and then returns to the point right after the call (EK AAP-3.A.4 in Topic 3.12).

### Where does the flow of control go after a procedure call finishes?

Control returns to the statement immediately after the procedure call, not the top of the program. The program picks up exactly where it left off and continues sequentially from there.

### Does a RETURN statement stop the whole program?

No. RETURN only exits the current procedure. It immediately sends control (and the returned value, if there is one) back to the point where the procedure was called, and the rest of the program keeps running.

### How is flow of control different from a procedure?

A procedure is a named group of instructions (EK AAP-3.A.1); flow of control is the path execution takes through the program. Calling a procedure changes the flow of control by jumping execution into that group of instructions and back out.

### Is flow of control on the AP CSP exam?

Yes. It's tested through code-tracing multiple-choice questions tied to Topic 3.12 and learning objective AP Comp Sci P 3.12.A, where you determine what a procedure call does and what the program outputs. It also matters when you explain your procedure in the Create Performance Task.

## 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/flow-of-control#resource","name":"Flow of Control — AP CSP Definition & Exam Guide","url":"https://fiveable.me/ap-comp-sci-p/key-terms/flow-of-control","learningResourceType":"Concept explainer","educationalLevel":"AP® / High School","about":{"@id":"https://fiveable.me/ap-comp-sci-p/key-terms/flow-of-control#term"},"audience":{"@type":"EducationalAudience","educationalRole":"student"},"dateModified":"2026-06-11T05:53:25.708Z","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/flow-of-control#term","name":"flow of control","description":"Flow of control is the order in which a program executes its statements. In AP Computer Science Principles, a procedure call interrupts normal top-to-bottom execution, runs the procedure's statements, and then returns control to the point immediately after the call (EK AAP-3.A.4).","url":"https://fiveable.me/ap-comp-sci-p/key-terms/flow-of-control","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 flow of control in AP Computer Science Principles?","acceptedAnswer":{"@type":"Answer","text":"Flow of control is the order in which a program's statements execute. AP CSP focuses on how a procedure call interrupts normal sequential execution, runs the procedure, and then returns to the point right after the call (EK AAP-3.A.4 in Topic 3.12)."}},{"@type":"Question","name":"Where does the flow of control go after a procedure call finishes?","acceptedAnswer":{"@type":"Answer","text":"Control returns to the statement immediately after the procedure call, not the top of the program. The program picks up exactly where it left off and continues sequentially from there."}},{"@type":"Question","name":"Does a RETURN statement stop the whole program?","acceptedAnswer":{"@type":"Answer","text":"No. RETURN only exits the current procedure. It immediately sends control (and the returned value, if there is one) back to the point where the procedure was called, and the rest of the program keeps running."}},{"@type":"Question","name":"How is flow of control different from a procedure?","acceptedAnswer":{"@type":"Answer","text":"A procedure is a named group of instructions (EK AAP-3.A.1); flow of control is the path execution takes through the program. Calling a procedure changes the flow of control by jumping execution into that group of instructions and back out."}},{"@type":"Question","name":"Is flow of control on the AP CSP exam?","acceptedAnswer":{"@type":"Answer","text":"Yes. It's tested through code-tracing multiple-choice questions tied to Topic 3.12 and learning objective AP Comp Sci P 3.12.A, where you determine what a procedure call does and what the program outputs. It also matters when you explain your procedure in the Create Performance Task."}}]},{"@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":"flow of control"}]}]}
```
