What output is produced by the following segment of code:
for(int i = 0; i < 10; i++)
cout << i << " ";
C++ - Loops and Random Numbers
Quiz
•
Computers
•
9th - 12th Grade
•
Medium
John Miller
Used 627+ times
FREE Resource
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What output is produced by the following segment of code:
for(int i = 0; i < 10; i++)
cout << i << " ";
0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9
Infinite Loop
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What output is produced by the following segment of code:
for(int i = 0; i <= 10; i++)
cout << i << " ";
0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9
Infinite Loop
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What output is produced by the following segment of code:
for(int i = 1; i <= 10; i++)
cout << i << " ";
0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9
Infinite Loop
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What output is produced by the following segment of code:
for(int fun = 20; fun > 1; fun -=3)
cout << fun << " ";
20 17 14 11 8 5 2 -1
20 17 14 11 8 5 2
17 14 11 8 5 2 -1
20 17 14 11 8 5
Infinite Loop
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What output is produced by the following segment of code:
int start = 5;
int end = 20;
for(; start <= end; start +=2)
cout << start << " ";
5 7 9 11 13 15 17 19 21
7 9 11 13 15 17 19 20
7 9 11 13 15 17 19 21
5 7 9 11 13 15 17 19
Infinite Loop
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What output is produced by the following segment of code:
for (int dmc = 8; dmc >= 0; dmc-=4)
cout << dmc << " ";
8 4 0
8 4
8
No Output
Infinite Loop
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What output is produced by the following segment of code:
for (int dmc = 8; dmc >= 8; dmc-=4)
cout << dmc << " ";
8 4 0
8 4
8
No Output
Infinite Loop
10 questions
Kuis Percabangan dan Perulangan
Quiz
•
10th Grade
17 questions
Elementele de bază ale limbajului C++
Quiz
•
10th Grade
13 questions
9-Cpp-1
Quiz
•
9th Grade
10 questions
Post Test C++
Quiz
•
9th - 12th Grade
15 questions
C++ SHS B1-B2
Quiz
•
11th Grade
15 questions
Pemograman Dasar
Quiz
•
10th Grade
12 questions
C++ References
Quiz
•
6th - 12th Grade
10 questions
Сpp 1_3
Quiz
•
9th - 12th Grade
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade
25 questions
Spanish preterite verbs (irregular/changed)
Quiz
•
9th - 10th Grade
10 questions
Identify Slope and y-intercept (from equation)
Quiz
•
8th - 9th Grade
10 questions
Juneteenth: History and Significance
Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1
Quiz
•
9th - 12th Grade
26 questions
June 19th
Quiz
•
4th - 9th Grade
20 questions
Distance, Midpoint, and Slope
Quiz
•
10th Grade
20 questions
Figurative Language Review
Quiz
•
10th Grade
27 questions
STAAR English 1 Review
Quiz
•
9th Grade