Control Flow
Control flow decides which statements run and how many times, using conditions and loops.
Beginner
Programs run top to bottom unless control flow changes the order. The two building blocks are branching (choose a path) and looping (repeat a block). With these plus sequence, you can express any algorithm.
Sub-topics (2)
Conditional Statements
if / else and switch statements run code only when a condition is true.
Beginner♥ 0🔖 0💬 0
Loops
Loops repeat a block of code — a fixed number of times (for) or while a condition holds (while).
Beginner♥ 0🔖 0💬 0
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.