Exam 5: Control Structures II Repetition
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C50 Questions
Exam 3: Inputoutput50 Questions
Exam 4: Control Structures I Selection50 Questions
Exam 5: Control Structures II Repetition50 Questions
Exam 6: User-Defined Functions50 Questions
Exam 7: User-Defined Simple Data Types, Namespaces, and the String Type50 Questions
Exam 8: Arrays and Strings50 Questions
Exam 9: Records Structs50 Questions
Exam 10: Classes and Data Abstraction49 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, and Abstract Classes50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Searching, Sorting and the Vector Type50 Questions
Exam 17: Linked Lists50 Questions
Exam 18: Stacks and Queues50 Questions
Select questions type
In a counter-controlled while loop, the loop control variable must be initialized before the loop.
(True/False)
4.9/5
(29)
The for loop body executes indefinitely if the loop condition is always ____________________.
(Short Answer)
4.8/5
(40)
What is the output of the following C++ code? num = 100;
while (num <= 150)
num = num + 5;
cout << num << endl;
(Multiple Choice)
4.9/5
(40)
The control statements in the for loop include the initial statement, loop condition, and update statement.
(True/False)
4.8/5
(39)
The function eof is a member of the data type ____________________.
(Short Answer)
4.9/5
(45)
The function srand takes as input a(n) ____________________ int, which acts as the seed for the algorithm.
(Short Answer)
4.8/5
(39)
Which of the following statements generates a random number between 0 and 50?
(Multiple Choice)
4.8/5
(40)
What is the output of the following loop? count = 5;
cout << 'St';
do
{
cout << 'o';
count--;
}
while (count <= 5);
(Multiple Choice)
4.8/5
(41)
Putting one control structure statement inside another is called ____________________.
(Short Answer)
4.8/5
(30)
A for loop is typically called a counted or ____________________ for loop.
(Short Answer)
4.9/5
(29)
What is the output of the following C++ code? count = 1;
num = 25;
while (count < 25)
{
num = num - 1;
count++;
}
cout << count << " " << num << endl;
(Multiple Choice)
4.9/5
(34)
In the case of the sentinel-controlled while loop, the first item is read before the while loop is entered.
(True/False)
4.8/5
(41)
When a continue statement is executed in a ____, the update statement always executes.
(Multiple Choice)
4.9/5
(42)
A(n) ____-controlled while loop uses a bool variable to control the loop.
(Multiple Choice)
4.8/5
(44)
A do...while loop is a(n) ____________________ loop, since the loop condition is evaluated after executing the body of the loop.
(Short Answer)
4.8/5
(37)
A semicolon at the end of the for statement (just before the body of the loop) is a(n) ____________________ error.
(Short Answer)
4.9/5
(44)
The ____ statement can be used to eliminate the use of certain (flag) variables.
(Multiple Choice)
5.0/5
(35)
What is the output of the following C++ code? int j;
for (j = 10; j <= 10; j++)
cout << j << " ";
cout << j << endl;
(Multiple Choice)
4.9/5
(30)
Showing 21 - 40 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)