Java Loops Quiz

Java Loops Quiz

University

53 Qs

quiz-placeholder

Similar activities

Ôn tập giữa học kì i môn GDQP-AN

Ôn tập giữa học kì i môn GDQP-AN

11th Grade - University

55 Qs

Ilmu Asas Technical Analysis Saham

Ilmu Asas Technical Analysis Saham

University

50 Qs

EXAMEN M I  - PRIMER PARCIAL

EXAMEN M I - PRIMER PARCIAL

University

50 Qs

1er Examen Parcial_IOT II_2022

1er Examen Parcial_IOT II_2022

University

55 Qs

Ujian Penilaian Pengetahuan EE-320-2 (1)

Ujian Penilaian Pengetahuan EE-320-2 (1)

University

50 Qs

MatSci Prelims

MatSci Prelims

University

50 Qs

9º ANO - QUIZIZZ EEBA

9º ANO - QUIZIZZ EEBA

8th Grade - University

50 Qs

Quiz Enzim dan Lipid

Quiz Enzim dan Lipid

University

50 Qs

Java Loops Quiz

Java Loops Quiz

Assessment

Quiz

Other

University

Practice Problem

Hard

Created by

mukilan selvaraj

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...

53 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a loop in Java?

for

while

loop

do-while

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax of a for loop?

for(initialization; condition; increment) { }

for(condition; initialization; increment) { }

for(increment; condition; initialization) { }

for(initialization, increment, condition) { }

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? for(int i = 0; i 0) { i--; System.out.println(i); }

5 4 3 2 1 0

4 3 2 1 0

5 4 3 2 1

4 3 2 1

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A while loop executes:

At least once

Zero or more times

Only once

Infinite times

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement is true about a do-while loop?

The loop executes only once

The condition is checked before execution

The loop executes at least once

It never executes

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output? int i = 1; do { System.out.print(i + " "); i++; } while (i < 4);

1 2 3

1 2 3 4

1 2

Infinite loop

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which loop is best when the number of iterations is unknown?

for

while

do-while

switch

Access all questions and much more by creating a free account

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

Already have an account?