Start learning today, and be successful in your academic & professional career. Start Today!

• ## Related Services

### Equality, Relational, & Logical Operators

• The == operator tests for equality; remember not to use = for this
• The other relational operators are != (not equal to), < (less than), <= (less than or equal to), > (greater than), and >= (greater than or equal to)
• Logical AND operator is &&; a && b is true only if a is true and b is also true
• Logical OR operator is ||; a || b is true if either a is true or b is true (or both are true)
• Logical NOT operator is !; !a is true is a is false; !a is false if a is true

### Equality, Relational, & Logical Operators

Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

• Intro 0:00
• Equality and Relational Operators 1:09
• Equal to
• Not Equal to
• Relational Operators
• Logical Operators 3:44
• Three Operators: And, Or, Not
• AND Defined
• OR Defined
• NOT Defined
• Example: And
• Example: Or
• Example: Not
• Truth Tables 7:16
• Truth Tables for AND
• Truth Tables for OR
• Truth Tables for NOT
• Short-Circuit Evaluation 10:03
• Example
• This Behavior Can be Useful in Program Design
• De Morgan's Laws 13:53
• First Law
• Second Law
• Operator Precedence 15:28
• List of Operators in Highest to Lowest Precedence
• Evaluation on Operators
• Summary 20:26