Search Header Logo

Compound Operators in Java

Authored by Patrick Bryar

Computers

9th - 12th Grade

Used 4+ times

Compound Operators in Java
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is printed when the following code segment is executed?

int j = 10;

int k = 8;

j += 2;

k += j;

System.out.print(j);

System.out.print(" ");

System.out.println(k);

10 20
12 20
12 22
10 22

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int x = 5;

int y = 3;

x *= 2;

y += x;

System.out.print(x);

System.out.print(" ");

System.out.println(y);

10 13
10 15
10 8
15 20

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is printed when the following code segment is executed?

int a = 12;

int b = 7;

a -= 3;

b *= a;

System.out.print(a);

System.out.print(" ");

System.out.println(b);

9 63
9 84
12 84
12 63

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is printed when the following code segment is executed?

int p = 6;

int q = 4;

p /= 2;

q -= p;

System.out.print(p);

System.out.print(" ");

System.out.println(q);

3 1
3 2
3 0
2 1

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is printed when the following code segment is executed?

int m = 9;

int n = 2;

m %= 3;

n += m;

System.out.print(m);

System.out.print(" ");

System.out.println(n);

1 3
2 4
0 2
0 3

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is printed when the following code segment is executed?

int r = 15;

int s = 5;

r += 10;

s *= r;

System.out.print(r);

System.out.print(" ");

System.out.println(s);

25 375
15 75

25 125

15 150

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is printed when the following code segment is executed?

int u = 20;

int v = 3;

u -= 5;

v *= u;

System.out.print(u);

System.out.print(" ");

System.out.println(v);

15 45
20 60
15 60
15 15

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?