Operators are tiny symbols with big jobs — arithmetic, comparison and logic, all squeezed between your values.
1 Arithmetic
+ - * / % do the math. Two hide traps: / drops the fraction between ints, % gives the remainder.
2 Relational
== != < > <= >= compare two values and produce 1 (true) or 0 (false).
3 Logical
&& is AND, || is OR, ! flips. They chain simple tests into bigger decisions.
4 Assignment
= stores a value. Its shortcuts += -= *= /= %= update a variable in one step.
Operators: the verbs of C
Arithmetic1+ - * / % do the math. Two hide traps: / drops the fraction between ints, % gives the remainder.
Relational2== != < > <= >= compare two values and produce 1 (true) or 0 (false).
Logical3&& is AND, || is OR, ! flips. They chain simple tests into bigger decisions. Assignment4= stores a value. Its shortcuts += -= *= /= %= update a variable in one step. 4 building blocks make up Operators: the verbs of C
One expression, four passes — click each stage to see how C untangles 2 + 3 * 5.
Two programs, two tabs — arithmetic and comparisons first, then the compound assignment shortcuts.
preprocessThe preprocessor pastes in stdio.h — printf comes from there.
Memory
no variables yet — press play
Console
output appears as the program runs…
The % operator shines inside conditions: n % 2 == 0 is true exactly for even numbers.
process decision input / output start / end Click a symbol, then click what it does to lock the pair.
6 conceptsTap a card to expand ?==drops into place
?&&drops into place
?!drops into place
?+=drops into place
Trace each printf by hand — then type your guess and check.
Your predicted output — one line per console line
Hint: int division drops the fraction (7 / 2 is 3), % keeps the remainder, and a true comparison prints 1.
01Arithmetic: + - * / % — int / int drops the fraction; % is the remainder.
02Comparisons produce 1 (true) or 0 (false); any non-zero value counts as true.
03&& means both, || means either, ! flips.
04= assigns; == compares. Mixing them up is the classic beginner bug.
05Compound shortcuts: coins += 5 is coins = coins + 5.