Which of the following loops print the numbers from 0 to 5?
Week 16 - CP1

Quiz
•
Computers
•
12th Grade
•
Hard
Rafael Araujo
Used 2+ times
FREE Resource
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int i=0;
while (i<5) {
System.out.println(i);
i++;}
int i=0;
while (i<7) {
System.out.println(i);
i++;}
int i=0;
while (i<6) {
System.out.println(i);
i++;}
int i=0;
while (i<=6) {
System.out.println(i);
i++;}
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why do we use loops?
To never end programming
To show off what you know
To avoid repeating the same instruction more than one time
To make it more complex
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When given:
int i=0;
while (i<5) {
System.out.println(i);
i++;}
Then i=0; means that
None
The first number to be printed is 0
It is the first natrual number
That it is a binary number
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When given:
int i=0;
while (i<5) {
System.out.println(i);
i++;}
The condition (i<5) means that:
All of them
The loop will continue occurring until the value of "i" becomes greater than or equal to 5
The loop will continue occurring until the value of "i" becomes less than or equal to 5
The loop will continue occurring indefinitely
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When given:
int i=0;
while (i<5) {
System.out.println(i);
i++;}
The instruction i++ means that:
I every iteration the value of "i" decreases by 2
I every iteration the value of "i" increases by 1
I every iteration the value of "i" increases by 2
I every iteration the value of "i" decreases by 1
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When given:
for (int i=0; i<5; i++) {
System.out.println(i);}
Then i=0; means that
The last value to be printed is 0
The first value to be printed is 0
Every time I write a loop I need to make "i" equal to 0
All of them
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When given:
for (int i=0; i<4; i++) {
System.out.println(i);}
The condition (i<4) means that:
All of them
The loop will continue occurring until the value of "i" becomes greater than or equal to 4
The loop will continue occurring until the value of "i" becomes less than or equal to 4
The loop will continue occurring indefinitely
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When given:
for (int i=5; i>0; i--) {
System.out.println(i);}
The instruction i-- means that:
I every iteration the value of "i" decreases by 2
I every iteration the value of "i" increases by 1
I every iteration the value of "i" increases by 2
I every iteration the value of "i" decreases by 1
9.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following loops print the numbers from 0 to 5?
for (int i=0; i<=6; i++) {
System.out.println(i);
}
for (int i=0; i<6; i++) {
System.out.println(i);
}
for (int i=0; i<5; i++) {
System.out.println(i);
}
for (int i=0; i>5; i++) {
System.out.println(i);
}
Similar Resources on Quizizz
10 questions
Arrays

Quiz
•
10th - 12th Grade
14 questions
PBO KELAS 12

Quiz
•
12th Grade
13 questions
APCSA Unit 3 Review

Quiz
•
9th - 12th Grade
12 questions
Loops

Quiz
•
9th - 12th Grade
10 questions
Introduction to Arrays

Quiz
•
KG - University
10 questions
AP Computer Science-Quiz 2(G10)

Quiz
•
9th - 12th Grade
8 questions
Quiz P2

Quiz
•
9th Grade - University
14 questions
Exploring Computer Science

Quiz
•
10th - 12th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University