Loops Quiz

Loops Quiz

9th - 12th Grade

16 Qs

quiz-placeholder

Similar activities

WORD

WORD

11th Grade

20 Qs

فيجوال بيسك

فيجوال بيسك

10th Grade

11 Qs

حاسب 1 نظري

حاسب 1 نظري

10th Grade

21 Qs

Ulangan harian 1 Algoritma dan Pemrograman

Ulangan harian 1 Algoritma dan Pemrograman

12th Grade - University

13 Qs

Quis Grade 5

Quis Grade 5

9th - 12th Grade

15 Qs

kuis informatika perangkat lunak

kuis informatika perangkat lunak

10th - 12th Grade

20 Qs

Input, output and storage de

Input, output and storage de

8th Grade - Professional Development

14 Qs

Ciklas for

Ciklas for

10th Grade

11 Qs

Loops Quiz

Loops Quiz

Assessment

Quiz

Computers

9th - 12th Grade

Practice Problem

Hard

Created by

Benjamin EnloeHS

Used 68+ times

FREE Resource

AI

Enhance your content in a minute

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

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

How many times will the following code print "Welcome to Java"?
int count = 0;
while (count < 10) {
 System.out.println("Welcome to Java");
 count++;
}

8
9
10
0

2.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

What is the output of the following code?
int x = 0;
while (x < 4) {
 x = x + 1;
}
System.out.println("x is " + x);

0
1
3
4

3.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

 Analyze the following code.
int count = 0;
while (count < 100) {
 // Point A
 System.out.println("Welcome to Java!");
 count++;
 // Point B
}
 // Point C

count < 100 is always true at Point B 
 count < 100 is always false at Point B
 count < 100 is always true at Point A  and count < 100 is always false at Point C
 count < 100 is always true at Point Coint C

4.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

How many times will the following code print "Welcome to Java"?
int count = 0;
do {
 System.out.println("Welcome to Java");
 count++;
} while (count < 10);

0
9
8
10

5.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Which of the following loops prints "Welcome to Java" 10 times?

A:
for (int count = 1; count <= 10; count++) {
 System.out.println("Welcome to Java");
for (int count = 2; count < 10; count++) {
 System.out.println("Welcome to Java");
}
for (int count = 1; count < 10; count++) {
 System.out.println("Welcome to Java");
}
for (int count = 0; count <= 10; count++) {
 System.out.println("Welcome to Java");
}

6.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

The following loop displays _______________.
for (int i = 1; i <= 10; i++) {
 System.out.print(i + " ");
 i++;
}

1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 
1 3 5 7 9

7.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

What is the output for y?
int y = 0;
for (int i = 0; i<10; ++i) {
 y += i;
}
System.out.println(y);

1
36
45
9

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?