Operators Flashcards

1
Q

Multiply 10 with 5, and alert the result:

A

alert(10 * 5);

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

Divide 10 by 2, and alert the result:

A

alert(10 / 2);

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

Alert the remainder when 15 is divided by 9.

A

alert(15 % 9);

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

Use the correct assignment operator that will result in x being 15 (same as x = x + y).
x = 10;
y = 5;

A

x += y;

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

Use the correct assignment operator that will result in x being 50 (same as x = x * y).
x = 10;
y = 5;

A

x *= y;

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

x = 3;

decrement x by 1

A

x–

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

c = 6;

increment c by 1

A

c++

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

x = 3;

What’s the shortcut for multiplying x by 4?

A

x *= 4

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

y = 25;

What’s the shortcut for dividing x by 5?

A

y /= 5

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