Chapter 2 - First Program Flashcards
1
Q
Comments
A
// comment here /* comment more than one line */
2
Q
“Are they not equal?”
A
!=
3
Q
“Are they equal?”
A
==
4
Q
Logical AND
A
&&
5
Q
NOT
A
!()
6
Q
OR
A
||
7
Q
BOOL type
A
holds the outcome of a conditional statement, is an alias for an int, and is zero if “false” and 1 if true typically
8
Q
Header for BOOL
A
include
9
Q
IF ELSE
A
if (conditional) { execute this statement } else { execute this statement instead }
10
Q
ELSE IF
A
if (conditional) { execute this statement } else if (conditional2) { execute this statement instead } .... else { // do this instead }
11
Q
CONDITIONAL TERNARY OPERATOR
A
int V = Boolean ? x:y - if the boolean is TRUE then V takes the value of x - otherwise if the boolean is FALSE then V takes the value of y. A more concise way of writing \_\_\_\_\_\_\_\_ if (Boolean) { V = x; } else { V = y; }