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);
13 questions
APCSA Unit 3 Review
Quiz
•
9th - 12th Grade
10 questions
Java: repetition control structure for & while
Quiz
•
10th - 12th Grade
15 questions
Class X - Java 1
Quiz
•
10th Grade
15 questions
Basics in Java
Quiz
•
9th - 12th Grade
15 questions
Java Level 1 - A
Quiz
•
12th Grade
16 questions
Arithmetic Types Declare Initialize Relation Logical Ops
Quiz
•
9th Grade - University
17 questions
"switch" Java Statement - 1
Quiz
•
9th - 10th Grade
10 questions
Quiz 15 - Array Basics
Quiz
•
11th Grade
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade
25 questions
Spanish preterite verbs (irregular/changed)
Quiz
•
9th - 10th Grade
10 questions
Identify Slope and y-intercept (from equation)
Quiz
•
8th - 9th Grade
10 questions
Juneteenth: History and Significance
Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1
Quiz
•
9th - 12th Grade
26 questions
June 19th
Quiz
•
4th - 9th Grade
20 questions
Distance, Midpoint, and Slope
Quiz
•
10th Grade
20 questions
Figurative Language Review
Quiz
•
10th Grade
27 questions
STAAR English 1 Review
Quiz
•
9th Grade