Chapter 7


  1. The increment operator increases a value by one.

  2. The decrement operator decreases a value by one.

  3. In the statement cout << --num, decrementing occurs before the outputting of the value of num because the decrementing is prefix.

  4. An iteration is each time a loop repeats.

  5. The usual purpose of the first expression in the parentheses following the for keyword is to initialize a variable which usually serves as the counter.

  6. The purpose of the second expression in the parentheses following the for keyword is to set the condition which must be true for the loop to continue to execute.

  7. The usual purpose of the third expression in the parentheses following the for keyword is to update a value, usually a counter.

  8. One or more of the expressions in the parentheses following the for keyword may be empty if handled elsewhere in the code.

  9. The purpose of the break keyword in a for loop is to prematurely terminate the loop.

  10. The purpose of the continue keyword in a for loop is to prematurely terminate the iteration of a loop.

  11. If you were going to use nested for loops to print rows and columns, you would use the inner for loop to print the columns .




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