Chapter 5 C++

¡Supera tus tareas y exámenes ahora con Quizwiz!

What will the following code display? int number = 6; cout <« number++ < endl;

6

The scope of a variable declared in a for loop's initialization expression always extends beyond the body of the loop.

False

Something within a while loop must eventually cause the condition to become false or a(n) results.

Infinite loop

The statements in the body of a while loop may never be executed while the statements in the body of a do-while loop will be executed

O at least once

A special value that marks the end of a list of values is a

O sentinel

What is the output of the following code segment? n = 1; while (n <= 5) cout « n « i n++;

O1 1... and on forever

Multiple relational expressions cannot be placed into the test condition of a for loop.

True

A statement that may be used to stop a loop's current iteration and begin the next one is

continue

The while loop is a ——-loop.

pre-test

A while loop's body can contain multiple statements, as long as they are enclosed in braces.

• True

An initialization expression may be omitted from the for loop if no initialization is required.

• True


Conjuntos de estudio relacionados

Fundamentals of nursing Unit 8 Ch 2

View Set

Meiosis: how does sexual reproduction lead to genetic variation?

View Set

BUS 404: Chapter 15 - Consumer Protection

View Set

HESI Cystic fibrosis Case Study Darla

View Set

International Business Chapter 7 Review

View Set

Chapter 48: Assessment and Management of Patients with Obesity

View Set