CS172 Final Exam York College

CS172 Final Exam York College

Assessment

Flashcard

Computers

Hard

Created by

Quizizz Content

FREE Resource

Student preview

quiz-placeholder

49 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Which of the following C++ loop structures always runs at least once? while, do-while, for, none of the loop types is guaranteed to run once

Back

do-while

2.

FLASHCARD QUESTION

Front

How many iterations does a loop with the following header make (assume the loop body makes no changes to i)?

for (int i = 1; i < 5; i++)

Back

4

3.

FLASHCARD QUESTION

Front

What is the output of the following code?
int count = 0;
do {
cout << count << " ";
count++;
} while (count < 5);

Back

0 1 2 3 4

4.

FLASHCARD QUESTION

Front

What output is produced by the following segment of code:
for (int x = 10; x > 0; x++)
cout << x << " ";

Back

Infinite Loop

5.

FLASHCARD QUESTION

Front

How many loop types are there in C++?

Back

3

6.

FLASHCARD QUESTION

Front

Fill in the blank to make this code print Go Heat! 3 times
int loop = 0;
while(__________) {
cout<<“Go Heat”<loop++;
}

Back

loop < 3

7.

FLASHCARD QUESTION

Front

What is the purpose of loops in programming?

Back

To execute a block of code multiple times

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?