For loop & While loop in Java

For loop & While loop in Java

Assessment

Flashcard

Computers

10th - 12th Grade

Practice Problem

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

29 questions

Show all answers

1.

FLASHCARD QUESTION

Front

What does the following code print? Options: 5 6 7 8 9, 4 5 6 7 8 9 10 11 12, 3 5 7 9 11, 3 4 5 6 7 8 9 10 11 12

Media Image

Back

3 4 5 6 7 8 9 10 11 12

2.

FLASHCARD QUESTION

Front

How many stars are printed? Options: 7, 3, 4, 5, Infinite Loop

Media Image

Back

4

3.

FLASHCARD QUESTION

Front

How many times does the following method print a *? Options: 9, 6, 7, 10

Media Image

Back

6

4.

FLASHCARD QUESTION

Front

How many times does the code print a * ?

Media Image

Back

8

5.

FLASHCARD QUESTION

Front

How many times does this print a * ?

Media Image

Back

4

6.

FLASHCARD QUESTION

Front

Which of the following loops prints "Welcome to Java" 10 times? Options: A: 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"); }

Back

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

7.

FLASHCARD QUESTION

Front

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

Back

1 2 3 4 5 6 7 8 9 10

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?