AP® Computer Science Principles · Big Idea 3 · Topic 3.5

Relational Operators and Boolean Values

Watch it explained

  1. How it worksHow do the operators for equal, not equal, greater, and less each evaluate to true or false?
  2. Worked exampleFind whether each of 5 > 3, 4 = 4, and 8 < 2 evaluates to true or to false.
  3. Common mistakeWhy isn't a Boolean value just a 1 or a 0 you can add into an arithmetic expression?
  4. Going furtherWhat happens when a relational operator compares two strings instead of two numbers?

Check yourself

Your turn1 of 2
How many of the integers from 1 to 73 are strictly greater than 6?

End of topic.