Assignment Operators Flashcards

1
Q

=

A

Assigns values from the right side operands to the left side.

Ex: “c = a + b” assigns value of ‘a + b’ to ‘c’

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

+=

A

Add AND

Adds the right operand to the left operand and assigns the result to the left operand

Ex: “c += a” is equivalent to “c = c + a”

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

-=

A

Subtract AND

Subtracts the right operand from the left operand and assigns the result to the left operand.

Ex: “c -= a” is equivalent to “c = c - a”

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

*=

A

Multiply AND

Multiplies the right operand with the left operand and assigns the result to the left operand.

Ex: “c *= a” is equivalent to “c = c * a”

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

/=

A

Divide AND

Divides the left operand with the right operand and assigns the result to the left operand.

Ex: “c /= a” is equivalent to “ c = c / a”

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

%=

A

Modulus AND

Takes modulus using two operands and assigning the result to the left operand

Ex: “c %= a” is equivalent to “c = c % a”

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

**=

A

Exponent AND

Preforms exponential calculation on operators and assigns the value to the left operand.

Ex: “c **= a” is equivalent to “c = c ** a”

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

//=

A

Floor Division

Preforms floor division on operators and assigns the value to the left operand.

Ex: “c // a” is equivalent to c = “c // a”

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