Compound Operators in Java

Compound Operators in Java

9th - 12th Grade

12 Qs

quiz-placeholder

Similar activities

conditional constructs in Java

conditional constructs in Java

10th Grade

10 Qs

Quiz 15 - Array Basics

Quiz 15 - Array Basics

11th Grade

10 Qs

Code.org APCSA Unit

Code.org APCSA Unit

10th - 12th Grade

10 Qs

Java Loops

Java Loops

9th - 12th Grade

12 Qs

Loops

Loops

9th - 12th Grade

10 Qs

For Loops

For Loops

9th - 12th Grade

10 Qs

Arithmetic Types Declare Initialize Relation Logical Ops

Arithmetic Types Declare Initialize Relation Logical Ops

9th Grade - University

16 Qs

"switch" Java Statement - 1

"switch" Java Statement - 1

9th - 10th Grade

17 Qs

Compound Operators in Java

Compound Operators in Java

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Patrick Bryar

Used 2+ times

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?