C++ Chapter 05

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

True/False: The condition that is tested by a while loop must be enclosed in parentheses and terminated with a semicolon.

False

True/False: The scope of a variable declared in a for loop's initialization expression always extends beyond the body of the loop.

False

True/False: A while loop's body can contain multiple statements, as long as they are enclosed in braces.

True

The statements in the body of a while loop may never be executed, whereas the statements in the body of a do-while loop will be executed: at least once at least twice as many times as the user wishes never None of these

at least once

This statement causes a loop to terminate early. stop break null terminate None of these

break

This statement may be used to stop a loop's current iteration and begin the next one. break terminate re-iterate continue None of these

continue

The do-while loop is a(n) ________ loop that is ideal in situations where you always want the loop to iterate at least once. post-test pre-test infinite null-terminated None of these

post-test

The do-while loop is considered a(n) ________ loop. pre-test post-test infinite limited None of these

post-test

The while loop is this type of loop. post-test pre-test infinite limited None of these

pre-test

This operator increments the value of its operand, then uses the value in context. prefix increment postfix increment prefix decrement postfix decrement None of these

prefix increment

This is a special value that marks the end of a list of values. constant variable loop sentinel None of these

sentinel

This is a control structure that causes a statement or group of statements to repeat. decision statement constant loop cout object None of these

loop

This is a pre-test loop that is ideal in situations where you do not want the loop to iterate if the condition is false from the beginning. do-while while for infinite None of these

while

The while loop has two important parts: an expression that is tested for a true or false value, and: a statement or block that is repeated as long as the expression is true a statement or block that is repeated only if the expression is false one line of code that is repeated once, if the expression is true a statement or block that is repeated once, if the expression is true

a statement or block that is repeated as long as the expression is true

True/False: The increment and decrement operators can be used in mathematical expressions; however, they cannot be used in relational expressions.

False

True/False: If you want to stop a loop before it goes through all its iterations, the break statement may be used.

True

This loop is a good choice when you know how many times you want the loop to iterate in advance of entering the loop. do-while while for infinite None of these

for

This means to increase a value by one. decrement increment modulus parse None of these

increment

The while loop contains an expression that is tested for a true or false value, and a statement or block that is repeated as long as the expression: is false is true does not evaluate to true or false evaluates to true or false None of these

is true


संबंधित स्टडी सेट्स

NRSG 102 lecture review for test1 17?'s

View Set

Government Chapter 4 Reading Quiz

View Set

Classes of life Insurance Policies

View Set

3.5 Special Cases: Repeated and Zero Eigenvalues

View Set