Unit 5 C++

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

The _____ statement is an effective way to avoid extra variables to control a loop and produce elegant code.

break

When the ____ statement executes in a repetition structure, it immediately exits from the structure.

break

When the ____ statement executes in a repetition structure, it skips the remaining statements in the loop and proceeds with the next iteration of the loop.

continue

The function rand() is defined in the header file ____.

cstdlib

The function time is defined in the header file ____.

ctime

Which of the following is the general form of the do...while statement?

do statement while (expression);

The ____ loop is a posttest loop.

do...while

The primary purpose of the ____ loop is to simplify the writing of counter-controlled loops.

for

The C++ eof function is a member of the data type ____.

istream

Which of the following is the syntax for using the eof function?

istreamVar.eof()

In the statement, while (cin), the variable cin acts as the ____.

loop control variable

Putting one control structure inside another is called ____.

nesting

The most common error associated with loops is a(n) _____ error.

off-by-one

A _____ is a special value that marks the end of the input data.

sentinel

A semicolon at the end of a for statement _____ the for loop.

terminates

In a for structure, the _____ statement is executed after the continue statement, and before the loop condition executes.

update

The _____ loop is a pretest loop.

while

When a program reads past the end of the input file, the expression ____ becomes false.

!infile.eof()

Which of the following is a Fibonacci sequence?

1,1,2,3,5,8

Which of the following statements is TRUE?

If the loop condition in a for loop is initially false, the loop body does not execute.


Ensembles d'études connexes

2.1 Why was there dissatisfaction with the peace settlements of 1919-20?

View Set

Pharmacy Technician Chpts 4, 14, 15

View Set

WEEK 4 / ALL practice questions from fundamentals + ati

View Set

Northern Ireland Trivia Scotland Wales

View Set

Chapter 11 and 12 - Axial Muscles and appendicular Muscles

View Set

Chapter 8 From the Great Crash to Wounded Knee

View Set

BCIS-5740 - Security Personnel + Security Technology (Chapter 7 and Chapter 8 )

View Set