question
A loop that continues to execute endlessly is called a(n) ____ loop.
question
A(n) ____-controlled while loop uses a bool variable to control the loop.
question
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.
question
In ____ structures, the computer repeats particular statements a certain number of times depending on some condition(s).
Don’t waste time
You can get a custom paper by one of our expert writers.
Get your custom essay
Helping students since 2015
question
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; cin >> num;}cout << sum << endl;
question
Suppose sum and num are int variables, and the input is 18 25 61 6 -1. What is the output of the following code?sum = 0;cin >> num;while (num != -1){ sum = sum + num; cin >> num;}cout << sum << endl;
question
The ____ statement can be used to eliminate the use of certain (flag) variables.
question
What executes immediately after a continue statement in a while and do-while loop?
answer
loop-continue test
question
What is the output of the following C++ code?count = 1;num = 25;while (count < 25){ num = num - 1; count++;}cout << count << << num << endl;
question
What is the output of the following C++ code?num = 10;while (num > 10) num = num - 2;cout << num << endl;
question
What is the output of the following loop?count = 5;cout << 'St';do{ cout << 'o'; count--;}while (count <= 5);
answer
This is an infinite loop.
question
Which executes first in a do...while loop?
question
Which of the following is a repetition structure in C++?
question
Which of the following statements generates a random number between 0 and 50?a. srand(time(0));num = rand() % 50;c. srand(time(0));num = rand()50;b. srand(time(10));num = rand()/50;d. srand(time(10));num = rand() % 50;
answer
srand(time(0));num = rand() % 50;
question
____ loops are called posttest loops.