GCSE Computer Science (OCR)

Topic Summaries

ALGORITHMS AND PROGRAMMING: Programming fundamentals

Comparison operators

  • These are used in conditions (e.g. in if or while statements) and always produce a Boolean result (True or False).
Operator Meaning Example
== Equal to x == 10
Not equal to x ≠ 10
< Less than x < 10
Less than or equal x ≤ 10
> Greater than x > 10
Greater than or equal x ≥ 10

Unlock Comparison operators

Sign up to unlock the rest of this topic — plus every other topic, video, flashcard set and eBook guide in your SnapRevise Digital subscription.

Cancel anytime — instant access the moment you sign up.