C Programming Chapter 6
The need to initialize vairables or make some oter evaluations prior to entering a repetition loop is so common that the...etc
for
In a(n) ____ loop the condition is tested at the end of the repeating section of code.
it is not: pretest
Each repetition in a loop is referred to as a(n) ____.
iteration
In a(n) ____ loop the condition is used to keep track of the number of repetitions that have occurred.
fixed-count
The ____ statement literally loops back on itself to recheck the expression until it evaluates to 0 (becomes false).
while
A posttest loop is also called an entranced-controlled loop.
False
A pretest loop is also called an exit-controlled loop.
False
The transfer of control back to the start of a while statement to reevaluate the expression is known as a program loop.
True
Before accumulating values, the accumulator variable should be initialized to ____.
0
The output of the following code is ____.count = 1; /* initialize count */while (count <= 10){printf("%d ",count);count++; /* increment count */}
1 2 3 4 5 6 7 8 9 10
The statement ___ is a null statement.
;
Care must be taken when choosing sentinel values
False
The construction for ( ; count <= 20;) is not valid.
False
The general form of the while statement is: statement; while (expression);
False
The input data validation application is ideally suited for a pretest loop.
False
The switch statement is a general repetition statement that can be used in a variety of pregramming situations.
False
In a(n) ____ loop the condition is tested before any statements within the loop are executed.
It is not: posttest pretest condition controlled must be: fixed-count no its not im confused
The break statement violates pure structured programming principles because it provides a second, nonstandard exit from a loop.
True
When a continue statement is encountered in a loop, the next iteration of the loop begins immediately.
True
In the following statements, the printf statement will be executed ____ times.count = 10;while (count <= 10)printf("%d ",count);
an infinite number of
In a(n) ____ loop the condition the tested condition does not depend on a count being achieved, but rather on a specific value being encountered.
condition-controlled
The ___ statement is simlar to the break statement but applies only to loops created with while, do-while, and for statements
continue
The ___ statement always creates a posttest loop.
do-while
If we were constructing a program that accepts student grades, a good sentinel value would be 0.
false
Not all loops require a condition that must be evaluated.
false
A(n) ____ loop is a condition-controlled loop that terminates when a value within a valid range is entered.
input-validation
A(n) ____ is a condition-controlled loop where one specific value is required to terminate the loop.
sentinel-controlled
Omitting the ____ expression in a for statement results in an infinite loop.
tested
Once a repetition statement is chosen, the other ____ elements of a loop are generally controlled by a single loop-control variable.
three
____ is an accumulating statement.
total += num;
total = total + num; is equivalent to ____.
total += num;