---
title: "Loop Body — AP Comp Sci A Definition & Exam Guide"
description: "The loop body is the block of code a loop repeats each iteration. Learn how to trace it, count its executions, and avoid infinite loops on the AP CSA exam."
canonical: "https://fiveable.me/ap-comp-sci-a/key-terms/loop-body"
type: "key-term"
subject: "AP Computer Science A"
---

# Loop Body — AP Comp Sci A Definition & Exam Guide

## Definition

The loop body refers to the block of code that gets executed repeatedly in a loop. It contains the instructions that are repeated until the loop condition becomes false.

## Related Study Guides

- [2.7 While Loops](/ap-comp-sci-a/unit-2/while-loops/study-guide/7qGsGOh1UKALAWpJhZOi)

## Review

### Related Terms

- [Loop Condition](/ap-comp-sci-a/key-terms/loop-condition): The loop condition determines whether the loop should continue executing or stop. It is evaluated before each iteration of the loop.
- [Iteration](/ap-comp-sci-a/key-terms/iteration): An iteration refers to each repetition of the loop body in a loop.
- [Infinite Loop](/ap-comp-sci-a/key-terms/infinite-loop): An infinite loop occurs when the loop condition always remains true, causing the loop body to repeat indefinitely.
