Loops Quiz
Quiz
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Hard
Benjamin EnloeHS
Used 68+ times
FREE Resource
Enhance your content in a minute
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++;
}
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);
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
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);
5.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
Which of the following loops prints "Welcome to Java" 10 times?
for (int count = 1; count <= 10; count++) {
System.out.println("Welcome to Java");
System.out.println("Welcome to Java");
}
System.out.println("Welcome to Java");
}
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++;
}
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);
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
15 questions
Ôn tập KTGK. Bài 17. Biến và lệnh gán
Quiz
•
10th Grade
20 questions
Data structure test1
Quiz
•
12th Grade
20 questions
Câu 21-40
Quiz
•
11th Grade
11 questions
Creative iMedia: Strengths, Weaknesses and Improvements
Quiz
•
10th Grade
11 questions
Програмне забезпечення та операційна система
Quiz
•
9th Grade
12 questions
Tabele HTML
Quiz
•
9th Grade
20 questions
Теги HTML
Quiz
•
10th Grade
20 questions
Bài tập về chương trình con
Quiz
•
11th Grade
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
