Unit 5 C++ GRADE A QUESTION WITH ANSWERS
The most common error associated with loops is a(n) _____ error. - (correct answer)off-
by-one
In the statement, while (cin), the variable cin acts as the ____. - (correct answer)loop
control variable
When the ____ statement executes in a repetition structure, it immediately exits from
the structure. - (correct answer)break
Which of the following is the general form of the do...while statement? - (correct
answer)do statement while (expression);
Which of the following is a Fibonacci sequence? - (correct answer)1,1,2,3,5,8
The _____ loop is a pretest loop. - (correct answer)while
A semicolon at the end of a for statement _____ the for loop. - (correct
answer)terminates
In a for structure, the _____ statement is executed after the continue statement, and
before the loop condition executes. - (correct answer)update
When a program reads past the end of the input file, the expression ____ becomes
false. - (correct answer)!infile.eof()
The ____ loop is a posttest loop. - (correct answer)do...while
The primary purpose of the ____ loop is to simplify the writing of counter-controlled
loops. - (correct answer)for
The most common error associated with loops is a(n) _____ error. - (correct answer)off-
by-one
In the statement, while (cin), the variable cin acts as the ____. - (correct answer)loop
control variable
When the ____ statement executes in a repetition structure, it immediately exits from
the structure. - (correct answer)break
Which of the following is the general form of the do...while statement? - (correct
answer)do statement while (expression);
Which of the following is a Fibonacci sequence? - (correct answer)1,1,2,3,5,8
The _____ loop is a pretest loop. - (correct answer)while
A semicolon at the end of a for statement _____ the for loop. - (correct
answer)terminates
In a for structure, the _____ statement is executed after the continue statement, and
before the loop condition executes. - (correct answer)update
When a program reads past the end of the input file, the expression ____ becomes
false. - (correct answer)!infile.eof()
The ____ loop is a posttest loop. - (correct answer)do...while
The primary purpose of the ____ loop is to simplify the writing of counter-controlled
loops. - (correct answer)for