
For Loops Lecture Questions

Quiz
•
Computers
•
9th Grade
•
Medium

Arasaka Teacher
Used 1+ times
FREE Resource
6 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
for(int i = 3; i > 0; i--) {
System.out.print(i + " ");
}
What is the output of the code above?
3 2 1 0
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
for (int i = 0; i < 4; i++); {
System.out.println(i);
}
What is the error in the code above?
There is no semicolon ( ; ) after the for loop
The code is correct
The print statement should be outside of the curly braces {}
The curly braces {} should be square brackets[]
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
for (int i = 0; i < 11; i++) {
System.out.println(i);
}
I want to change the above code so that it counts from 5 to 10 instead of 0 to 10. What code should I change?
for (int i = 1; i <= 5; i++)
{ System.out.println(i); }
for (int i = 5; i < 11; i++)
{ System.out.println(i); }
for (int i = 5; i < 11; i++)
{ System.out.println(i); }
for (int i = 0; i < 11; i+=2)
{ System.out.println(i); }
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int count = 0;
for (int i = 10; i > 0; i--)
System.out.println(i);
count++;
What is the problem with the code above?
There is a missing semicolon ( ; )
There are no curly braces {}
There are no square brackets []
The code is correct
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
for (int i = 10; i < 20; i += 3) {
System.out.println(i);
}
What is the output of the code above?
13
16
19
22
10
13
16
19
22
13
16
19
6.
OPEN ENDED QUESTION
3 mins • 1 pt
int[] nums = {1, 2, 3, 4};
int index = 0;
while (index < nums.length) {
nums[index] *= 2;
index += 2;
}
Rewrite the above code so that it uses a for loop instead of a while loop.
Evaluate responses using AI:
OFF
Similar Resources on Wayground
10 questions
PC1.8 Evaluate computer program

Quiz
•
9th Grade
10 questions
Delphi Arguments/Returns

Quiz
•
8th - 10th Grade
10 questions
C++ Basics Quiz

Quiz
•
9th - 12th Grade
10 questions
APCSA - Unit 3

Quiz
•
9th - 12th Grade
11 questions
Project STEM AP CS A Unit 1 Quiz Review

Quiz
•
9th - 12th Grade
11 questions
Learning Variables

Quiz
•
9th - 12th Grade
6 questions
Delphi Revision Part 1

Quiz
•
9th - 10th Grade
10 questions
Java Basics Quiz

Quiz
•
9th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade