Chapter 8


  1. The do while loop executes at least once.

  2. The for loop is the best choice when the number of iterations is predictable.

  3. The parenthetical expression following the while keyword is for the condition.

  4. The parenthetical condition following the while keyword may always be true, such as while (true). However, to avoid an infinite loop, the break keyword would need to be used in the body of the loop.

  5. The parenthetical condition following the while keyword may combine two expressions using a logical && or operator.

  6. The purpose of the break keyword in a while loop is the same as it is in a for loopto prematurely terminate the loop.

  7. The purpose of the continue keyword in a while loop is the same as it is in a for loop, to prematurely terminate the iteration of a loop.

  8. A flag is a Boolean variable whose value indicates whether a condition exists.

  9. If you were going to use nested while loops to print rows and columns , you would use the outer for loop to print the rows.

  10. A variable declared inside the body of a do while loop does not have scope in the parenthetical expression following the while keyword.




C++ Demystified(c) A Self-Teaching Guide
C++ Demystified(c) A Self-Teaching Guide
ISBN: 72253703
EAN: N/A
Year: 2006
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net