Comparison and Logical Operators Flashcards
1
Q
==
A
Equal to, x == y
2
Q
!=
A
Not equal, x != y
3
Q
>
A
Greater than, x > y
4
Q
<
A
Less than, x < y
5
Q
> =
A
Greater than or equal to, x >= y
6
Q
<=
A
Less than or equal to, x <= y
7
Q
&&
A
Logical and, Returns true if both statements are true, x < 5 && x < 10
8
Q
||
A
Logical or, Returns true if one of the statements is true x < 5 || x < 4
9
Q
!
A
Logical not, Reverse the result, returns false if the result is true, !(x < 5 && x < 10)