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

Flashcard
•
Computers
•
9th - 12th Grade
•
Hard
Quizizz Content
FREE Resource
Student preview

16 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Back
10
2.
FLASHCARD QUESTION
Front
What is the output of the following code?
int x = 0;
while (x < 4) {
x = x + 1;
}
System.out.println("x is " + x);
Back
4
3.
FLASHCARD QUESTION
Front
Analyze the following code.
int count = 0;
while (count < 100) {
// Point A
System.out.println("Welcome to Java!");
count++;
// Point B
}
// Point C
Options: 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 C
Back
count < 100 is always true at Point A and count < 100 is always false at Point C
4.
FLASHCARD QUESTION
Front
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);
Back
10
5.
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 = 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");
}.
Back
for (int count = 1; count <= 10; count++) {
System.out.println("Welcome to Java");
6.
FLASHCARD QUESTION
Front
The following loop displays _______________.
for (int i = 1; i <= 10; i++) {
System.out.print(i + " ");
i++;
}
Back
1 3 5 7 9
7.
FLASHCARD QUESTION
Front
What is the output for y?
int y = 0;
for (int i = 0; i < 10; ++i) {
y += i;
}
System.out.println(y);
Back
45
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
Java Loops

Flashcard
•
9th - 12th Grade
11 questions
Java Boolean Statements

Flashcard
•
11th Grade
14 questions
Javascript Control Structures Practice

Flashcard
•
9th - 12th Grade
9 questions
Java For Loops

Flashcard
•
9th - 12th Grade
12 questions
java while loop

Flashcard
•
9th - 12th Grade
13 questions
Functions and Parameters

Flashcard
•
9th - 12th Grade
10 questions
Arrays

Flashcard
•
10th - 12th Grade
11 questions
for and while loops level 2

Flashcard
•
9th - 12th Grade
Popular Resources on Wayground
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice

Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers

Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade
Discover more resources for Computers
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade