Increment and Decrement Flashcards

1
Q

what does count ++ have the same meaning as

A

count=count + 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

when do post increments happen

A

after the variable is used

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

when do pre increments happen

A

before the variable is used

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

post decrement looks like

A

variable –

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

pre decrement looks likke

A

–variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

precedence of the following line

int result = value1++ + value2;

A
  1. addition
  2. post increment
  3. equals sign
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

precedence of the following line

int result = value2 % –value3;

A
  1. pre decrement
  2. modulus
  3. equals sign
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

precedence of the following line

int result = ++value2 + value3–;

A
  1. pre increment
  2. addition
  3. post decrement
  4. equals sign
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

precedence of the following line

int result = value1++ + value1

A

immediately after we access the 1 value it is incremented

How well did you know this?
1
Not at all
2
3
4
5
Perfectly