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
The number of iterations of a counter-controlled loop is known in advance.
(True/False)
4.8/5
(32)
In a(n) "____________________" problem, either the loop executes one too many or one too few times.
(Short Answer)
4.8/5
(41)
In ____ structures, the computer repeats particular statements a certain number of times depending on some condition(s).
(Multiple Choice)
4.7/5
(37)
In a sentinel-controlled while loop, the body of the loop continues to execute until the EOF symbol is read.
(True/False)
4.8/5
(45)
Assume all variables are properly declared. The output of the following C++ code is 2 3 4 5.
n = 1;
while (n < 5)
{
n++;
cout << n << " ";
}
(True/False)
4.9/5
(45)
Suppose j, sum, and num are int variables, and the input is 26 34 61 4 -1. What is the output of the code? sum = 0;
cin >> num;
for (int j = 1; j <= 4; j++)
{
sum = sum + num;
xin >> num;
}
cout << sum << endl;
(Multiple Choice)
4.7/5
(34)
Consider the following code. (Assume that all variables are properly declared.) cin >> ch;
While (cin)
{
cout << ch;
cin >> ch;
}
This code is an example of a(n) ____ while loop.
(Multiple Choice)
4.8/5
(37)
The statement in the body of a while loop acts as a decision maker.
(True/False)
4.8/5
(40)
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.7/5
(41)
Showing 41 - 50 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)