Increment and Decrement Flashcards
1
Q
what does count ++ have the same meaning as
A
count=count + 1
2
Q
when do post increments happen
A
after the variable is used
3
Q
when do pre increments happen
A
before the variable is used
4
Q
post decrement looks like
A
variable –
5
Q
pre decrement looks likke
A
–variable
6
Q
precedence of the following line
int result = value1++ + value2;
A
- addition
- post increment
- equals sign
7
Q
precedence of the following line
int result = value2 % –value3;
A
- pre decrement
- modulus
- equals sign
8
Q
precedence of the following line
int result = ++value2 + value3–;
A
- pre increment
- addition
- post decrement
- equals sign
9
Q
precedence of the following line
int result = value1++ + value1
A
immediately after we access the 1 value it is incremented