Exam 5: Control Structures Ii Repetition
Exam 1: An Overview of Computers and Programming Languages40 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Inputoutput40 Questions
Exam 4: Control Structures I Selection40 Questions
Exam 5: Control Structures Ii Repetition40 Questions
Exam 6: User-Defined Function41 Questions
Exam 7: Namespaces, the Class String, and User-Defined Simple Data Types40 Questions
Exam 8: Arrays40 Questions
Exam 9: Records Structs40 Questions
Exam 10: Classes and Data Abstraction43 Questions
Exam 11: Inheritance and Composition41 Questions
Exam 12: Pointers, Classes, Virtual Functions, and Abstract Classes44 Questions
Exam 13: Operator Overloading and Templates41 Questions
Exam 14: Exception Handling43 Questions
Exam 15: Recursion43 Questions
Exam 16: Linked Lists40 Questions
Exam 17: Stacks and Queue43 Questions
Exam 18: Searching and Sorting Algorithms40 Questions
Exam 19: Binary Trees43 Questions
Exam 20: Graph Algorithms48 Questions
Exam 21: Standard Template Library41 Questions
Select questions type
Which executes first in a do...while loop?
Free
(Multiple Choice)
4.8/5
(38)
Correct Answer:
A
A loop ____________________ is a set of statements that remains true each time the loop body is executed.
Free
(Short Answer)
4.8/5
(37)
Correct Answer:
invariant
What is the output of the following C++ code? 

Free
(Multiple Choice)
4.8/5
(39)
Correct Answer:
C
The number of iterations of a counter-controlled loop is known in advance.
(True/False)
4.7/5
(36)
The control statements in the for loop include the initial statement, loop condition, and update statement.
(True/False)
4.9/5
(30)
To generate a random number, you can use the function rand of the header file ____________________.
(Short Answer)
4.8/5
(44)
In ____ structures, the computer repeats particular statements a certain number of times depending on some condition(s).
(Multiple Choice)
4.9/5
(33)
In a while and for loop, the loop condition is evaluated before executing the body of the loop.Therefore, while and for loops are called ____________________ loops.
(Short Answer)
4.9/5
(42)
Consider the following code. This code is an example of a(n) ____ while loop.


(Multiple Choice)
4.9/5
(38)
The following while loop terminates when j > 20.
j = 0;
while (j < 20)
j++;
(True/False)
4.7/5
(39)
Consider the following code.(Assume that all variables are properly declared.) This code is an example of a(n) ____ while loop.


(Multiple Choice)
5.0/5
(31)
A loop that continues to execute endlessly is called a(n) ____ loop.
(Multiple Choice)
4.9/5
(34)
Which of the following loops does not have an entry condition?
(Multiple Choice)
4.9/5
(34)
In a counter-controlled while loop, the loop control variable must be initialized before the loop.
(True/False)
4.9/5
(32)
What executes immediately after a continue statement in a while and do-while loop?
(Multiple Choice)
4.8/5
(38)
The control variable in a flag-controlled while loop is a bool variable.
(True/False)
4.8/5
(45)
Assume that all variables are properly declared.The following for loop executes 20 times.
for (i = 0; i <= 20; i++)
cout << i;
(True/False)
4.8/5
(45)
What is the next Fibonacci number in the following sequence? 1, 1, 2, 3, 5, 8, 13, 21, ...
(Multiple Choice)
4.9/5
(44)
Showing 1 - 20 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)