// forloop_02.cpp - for loops revisited
#include <iostream>

int main() {
  using namespace std;
  int countStart;

  cout << "Please enter a countdown value: ";
  cin >> countStart;

  //NOTE:
  // 1. we are declaring i within the installation step
  // 2. the update variable is i-- (which means i=i-1).
  //    this means that each time through the loop, 1 is 
  //    subtracted from the loop.
  //
  // this is the same as: 
  // for(int i=countStart; i; i--)
  for(int i=countStart;i>0;i--) {
    cout << "i = " << i << endl;
  }

  // NOTE that when we initialize i in our for loop, the i is
  // only defined within the brackets... the following will give
  // an error, since its outside the brackets
  //
  //cout << i;

  cout << "\nThats it.\n";

}

