🧩Control Flow
Also known as Flow of Control
The order a program runs its steps in. Ifs skip lines; loops repeat them.
Think of it like
Think of it like a board game. Most turns you move ahead, but some squares send you back or let you skip.
Example
A quiz app asks a question, then jumps to the right or wrong screen. Then it loops back for the next question.
Why it matters
Without control flow, a program could only run every line once, in order. Choices and repeats come from here.
Definition
Common mistake
Key takeaways
- 1Top to bottom first. Lines run in order unless told otherwise.
- 2Choose and repeat. Ifs pick a path; loops go round again.
- 3Jump and return. A function call goes away and comes back.