chapter 3 Flashcards
logical value/ Boolean value
can either be true (1) or false (0)
logical variable
can only hold logical values
logical operator
compares 2 logical variables to reach logical decision that results in logical value is true or false
And operator
&
returns true if logical variable a and b are BOTH TRUE
Or operator
returns true if a or b is true (ANY TRUE)
Not operator
~
returns true if A is false and B is true and vice versa (OPPOSITES)
Xor operator
returns true if a or b is true but NOT BOTH
exclusive
xor(a, b)
equality operator
whether two numbers are equal
a = = b
a is equal to b
a ~ = b
a is not equal to b
relational operator
compares numbers and evaluates to true or false
a<b
a is less than b
a>b
a is greater than b
a <= b
a is less than or equal to b
a => b
a is more than or equal to b