Java Code Output Quiz

Java Code Output Quiz

9th - 12th Grade

30 Qs

quiz-placeholder

Similar activities

Materi Berpikir Komputasional Kelas 10

Materi Berpikir Komputasional Kelas 10

10th Grade

25 Qs

KUIS ADMINISTRASI SISTEM JARINGAN

KUIS ADMINISTRASI SISTEM JARINGAN

11th Grade

25 Qs

Ulangan Harian Analisis Data

Ulangan Harian Analisis Data

12th Grade

25 Qs

Ulangan Logika Dasar Matematika

Ulangan Logika Dasar Matematika

10th Grade

25 Qs

SAS 1 Informatika 8

SAS 1 Informatika 8

8th Grade - University

25 Qs

Seni Budaya Quiz

Seni Budaya Quiz

11th Grade - University

25 Qs

1-kurs 1-semestr YAKUNIY 2025

1-kurs 1-semestr YAKUNIY 2025

10th Grade

25 Qs

UTS INFORMATIKA KELAS E

UTS INFORMATIKA KELAS E

8th Grade - University

25 Qs

Java Code Output Quiz

Java Code Output Quiz

Assessment

Quiz

Information Technology (IT)

9th - 12th Grade

Practice Problem

Hard

Created by

chrisbenedict sevilleno

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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"); }

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

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?