๐Ÿ’ปap computer science a review

If-else statement

Written by the Fiveable Content Team โ€ข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโ€ขWritten by the Fiveable Content Team โ€ข Last updated September 2025

Definition

An if-else statement is a programming construct that allows the program to make decisions based on certain conditions. It checks a condition and executes one block of code if the condition is true, and another block of code if the condition is false.

"If-else statement" also found in:

If-else statement Definition - AP Computer Science A Key Term | Fiveable