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);
Compound Operators in Java
Quiz
•
Computers
•
9th - 12th Grade
•
Medium
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);
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);
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);
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);
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);
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 125
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);
16 questions
Arithmetic Types Declare Initialize Relation Logical Ops
Quiz
•
9th Grade - University
16 questions
Loops
Quiz
•
5th - 12th Grade
10 questions
AP CSA Unit 1 & 2 Review
Quiz
•
9th - 12th Grade
15 questions
Java Math
Quiz
•
9th - 12th Grade
17 questions
"switch" Java Statement - 1
Quiz
•
9th - 10th Grade
16 questions
Loops Quiz
Quiz
•
9th - 12th Grade
10 questions
Quiz 15 - Array Basics
Quiz
•
11th Grade
7 questions
Pentaksiran T4(menulis kod arahan Java)
Quiz
•
11th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression
Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University