← all problems

Boolean Operators: Quick Reference 🌶️

This page reviews the three boolean operators you'll use constantly in conditionals, then checks your understanding with a couple of quick questions.

The three operators:
OperatorMeaningTrue when
&&ANDboth sides are true
||ORat least one side is true
!NOTflips true to false, or false to true

A few things worth remembering:
Common mistake: writing if (x = 5) instead of if (x == 5). A single = is assignment, not comparison — and it compiles without error, which is exactly why it's dangerous.

1. Which expression is true when at least one of a or b is true, but not necessarily both?

Your score for your class is recorded when you click Submit all — checking individual questions doesn't save it. You can submit again to improve your score; your best one counts.