What will this code print? int x = 0; if (x == 0) { System.out.println("Zero"); } else if (x > 0) { System.out.println("Positive"); } else { System.out.println("Negative"); }
Java Code Output Quiz

Quiz
•
Information Technology (IT)
•
9th - 12th Grade
•
Hard
chrisbenedict sevilleno
Used 1+ times
FREE Resource
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Zero
Positive
Negative
Nothing
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does this code print? int i = 0; while (i 0; i--) { System.out.print(i + " "); }
1 2 3
3 2 1
3 2
2 1 0
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many times does this loop run? int x = 5; while (x > 0) { x--; } System.out.println(x);
4
5
6
Infinite
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of this code? for (int i = 1; i 1; i--) { if (i == 3) break; System.out.print(i + " "); }
5 4 3
5 4
4 3 2
5 4 2
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of this nested loop? for (int i = 1; i 0) { for (int j = 0; j 1) { System.out.print(x + " "); x--; }
4 3 2
4 3 2 1
3 2 1
4 3
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will this code output? int count = 0; for (int i = 1; i <= 4; i++) { if (i % 3 == 0) count++; } System.out.println(count);
1
2
3
4
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of this code? int i = 0; while (i < 5) { if (i % 2 == 0) { System.out.print(i + " "); } i++; }
0 2 4
1 3 5
0 2
2 4
Create a free account and access millions of resources
Similar Resources on Quizizz
30 questions
embedded system (OOP program)

Quiz
•
11th Grade
25 questions
Understanding 1D Arrays in C

Quiz
•
12th Grade
25 questions
Kuis Tambahan Python

Quiz
•
9th - 12th Grade
25 questions
3 Tri C# 2

Quiz
•
12th Grade
25 questions
2-semestr Yakuniy Nazorat

Quiz
•
10th Grade
25 questions
Quizizz SIOTICS #1

Quiz
•
10th Grade
34 questions
Python Basic (Grade9)

Quiz
•
9th Grade
30 questions
Form 4 - CSEC Information Technology Quiz

Quiz
•
10th Grade - University
Popular Resources on Quizizz
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
Discover more resources for Information Technology (IT)
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