
Loops (Nested too)
Authored by Raymond Chan
Computers
9th - 12th Grade
Used 489+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
What does the following code print?
5 4 3 2 1
-5 -4 -3 -2 -1
-4 -3 -2 -1 0
None of the above
2.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
Consider the following code segment. Which of the following can be used as a replacement for the missing loop header so that the loop prints out “0 2 4 6 8 10”?
while (count == 10)
while (count < 10)
while (count <= 10)
while (count > 10)
3.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
Consider the following code segment. What is count’s value after running this code segment?
0
1
16
6
4.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
What does the following code print?
for (int i = 3; i < 8; i++)
{
System.out.print(i + " ");
}
3 4 5 6 7 8
0 1 2 3 4 5 6 7 8
8 8 8 8 8
3 4 5 6 7
5.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
What does the following code print?
7 rows with 5 columns
7 rows with 4 columns
6 rows with 5 columns
6 rows with 4 columns
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code print?
A rectangle of 4 rows with 3 star per row.
A rectangle of 5 rows with 3 stars per row.
A rectangle of 4 rows with 1 star per row.
The loops have errors.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the values of var1 and var2 when the code finishes executing?
var1 = 1, var2 = 1
var1 = 2, var2 = 0
var1 = 3, var2 = -1
var1 = 0, var2 = 2
The loop will cause a run-time error with a division by zero.
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
10 questions
DTJSQuiz
Quiz
•
11th Grade
13 questions
Python
Quiz
•
9th Grade
10 questions
Treasure Hunt
Quiz
•
12th Grade
12 questions
АЛГОРИТМІЗАЦІЯ 7 КЛ частина 1
Quiz
•
12th Grade
10 questions
Одновимірні масиви.
Quiz
•
10th Grade
12 questions
BAI 25_TINHOC
Quiz
•
10th Grade
10 questions
R082 Book Cover Assets planning
Quiz
•
7th - 12th Grade
10 questions
python
Quiz
•
10th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade