Comparisons ask a yes/no question: >, <, >=, <=, ==, !=. In C the result is 1 (true) or 0 (false).
A comparison asks a yes-or-no question about two values: bigger, smaller, equal, not equal. In C the answer is the number 1 (yes) or 0 (no). An if statement uses that answer to pick a path.
left
compare
right
print Yes
Each step highlights the matching C line. Program output appears only when a line that prints actually runs.
Five questions. Pick one answer each, then Check answers. The correct choice turns green.
1. 5 > 3 is:
Comparison yields 1 or 0.
2. Equality test spelling is:
Two equals.
3. This program prints:
if body runs.
4. if (a = b) is dangerous because:
Assignment, not compare.
5. != means:
Inequality.