Programs get interesting when they choose. if/else picks a path, ladders pick among many, switch jumps straight to a match.
1 if / else
Runs a block only when a condition is true. else catches every other case.
2 else-if ladder
Chain tests top to bottom; the first true branch wins and the rest are skipped.
3 switch
Compare one value against many cases — jump straight to the match, then break out.
4 Conditions are numbers
Comparisons in C produce 1 for true and 0 for false. Any non-zero value counts as true.
Making decisions
if / else1Runs a block only when a condition is true. else catches every other case.
else-if ladder2Chain tests top to bottom; the first true branch wins and the rest are skipped. switch3Compare one value against many cases — jump straight to the match, then break out.
Conditions are numbers4Comparisons in C produce 1 for true and 0 for false. Any non-zero value counts as true. 4 building blocks make up Making decisions
if/else sends the program down exactly one of two paths — never both.
process decision input / output start / end The value is tested against each case from the top — the first match wins, then break ends the jump.
process decision input / output start / end Two programs, two tabs — watch the if branch skip the else, then watch switch jump straight into case 3.
preprocessThe preprocessor pastes in stdio.h — printf comes from there.
Memory
no variables yet — press play
Console
output appears as the program runs…
In a ladder, only the first true branch runs — trace from the top.
Your predicted output — one line per console line
Hint: Check each condition from the top: 85 >= 90 fails, but 85 >= 80 passes — the rest are never tested.
Click a keyword, then click its job to lock the pair.
5 conceptsTap a card to expand ?if / elsedrops into place
?else ifdrops into place
?switchdrops into place
?breakdrops into place
?defaultdrops into place
01if/else picks exactly one path — the skipped branch never runs.
02In an else-if ladder the first true condition wins.
03switch jumps to the matching case; break stops it from falling through.
04Conditions produce 1 (true) or 0 (false) in C.
05A condition that never turns false gives an infinite loop — usually a bug.