Chapter 3 Flashcards
1
Q
the if(condition) must be
A
a boolean, true or false
2
Q
If the condition is true
A
the statement is executed, if not skipped
3
Q
==
A
equals
4
Q
!=
A
does not equal
5
Q
<=
A
less than or equal to
6
Q
> =
A
greater than or equal to
7
Q
else is similar to
A
otherwise
8
Q
Without braces
A
only one statement can follow the if statement
9
Q
a && b
A
if both a and b are true, executes
10
Q
a || b
A
If either a or b are true, executes
11
Q
!a
A
executes if a is false
12
Q
&& and || are
A
binary operators
13
Q
order of logical precedence
A
NOT over AND and OR
14
Q
De Morgan’s theorem
A
When the not (!) is distributed to the variable in the parentheses
15
Q
short circuiting
A
when the left operand of an “&&” statement or “||” is true, other part is not evaluated