Flashcard 2 - CC103 - Midterm

Flashcard 2 - CC103 - Midterm

Assessment

Flashcard

Other

University

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

20 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Which of the following correctly describes a while loop? Options: Executes at least once before checking the condition, Continues executing as long as the condition is true, Always executes exactly 10 times, Executes only if the condition is false

Back

Continues executing as long as the condition is true

2.

FLASHCARD QUESTION

Front

What is the main difference between a while loop and a do while loop?

Back

A while loop checks the condition before executing.

3.

FLASHCARD QUESTION

Front

Which of the following syntax is correct for a while loop in C++? Options: while (condition);, while (condition) { statements; }, do { statements; }, if (condition) { statements; }

Back

while (condition) { statements; }

4.

FLASHCARD QUESTION

Front

What happens if the while loop condition never becomes false?

Back

It results in an infinite loop.

5.

FLASHCARD QUESTION

Front

Which loop is guaranteed to execute at least once? Options: For loop, While loop, Do while loop, None of the above

Back

Do while loop

6.

FLASHCARD QUESTION

Front

What is the correct syntax for a do while loop in C++?

Back

do { statements; } while (condition);

7.

FLASHCARD QUESTION

Front

What is the purpose of using a while loop?

Back

To execute code as long as a condition is true.

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?