what is the initial statement in the following for loop? int i; |
i = 1 |
a loop that continues to execute endlessly is called a(n) ____ loop. |
infinite |
What executes immediately after a continue statement in a while and do-while loop? |
loop-continue test |
____ loops are called posttest loops. |
do while |
In a sentinel-controlled while loop, the body of the loop continues to execute until the EOF symbol is read. ( t or f ) |
false |
The control statements in the for loop include the initial statement, loop condition, and update statement. ( t or f ) |
true |
In ____ structures, the computer repeats particular statements a certain number of times depending on some condition(s). |
looping |
Which of the following loops is guaranteed to execute at least once? |
do while loop |
Which of the following loops does not have an entry condition? |
A do while loop |
Which of the following is a repetition structure in C++? |
do while |
The statement in the body of a while loop acts as a decision maker. ( t or f ) |
false |
The ____ statement can be used to eliminate the use of certain (flag) variables. |
break |
When a continue statement is executed in a ____, the update statement always executes. |
for loop |
What is the value of x after the following statements execute? int x = 5; |
40 |
Assume that all variables are properly declared. The following for loop executes 20 times. |
false |
Which executes first in a do…while loop? |
the statement |
Suppose j,sum,and num are int variables, and the input is 26 34 61 4 -1.Whatisthe output of the code? sum = 0; |
125 |
What is the output of the following C++ code? |
25 1 |
What is the output of the following loop? |
this is an infinite loop |
Assume all variables are properly declared. The output of the following C++ code is 2 3 4 5. n = 1; |
True |
Which of the following statements generates a random number between 0 and 50? |
srand(time(0)); num = rand() % 50; |
The following while loop terminates when j > 20. |
false |
What is the output of the following C++ code? int j; |
11 11 |
What is the output of the following C++ code? |
10 |
In the case of the sentinel-controlled while loop, the first item is read before the while loop is entered.( t or f) |
True |
Chapter 5 – CS123
Share This
Unfinished tasks keep piling up?
Let us complete them for you. Quickly and professionally.
Check Price