&& is and, || is or, ! is not. C stops early when the answer is already known (short-circuit).
Logical operators combine yes/no values. And (&&) needs both. Or (||) needs at least one. Not (!) flips the answer. They are how you write “door closed and seatbelt on.”
true
and
false
Not both
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. 1 && 0 is:
And needs both true.
2. This program prints:
else branch.
3. || is:
Logical or.
4. !x is true when x is:
Not: 0 becomes 1.
5. Short-circuit && means:
Left false → skip right.