// nestedloops_01.cpp - introduction to nested for loops
#include <iostream>

int main() {
  using namespace std;

  const int dim = 7;

  // this program has a loop within a loop, which is called a nested
  // for loop. nested for loops are often used with 2D arrays. the 
  // following shows how nested for loops can create a coordinate system.
  for(int y=0;y<dim;y++) {
    for(int x=0;x<dim;x++) {
      cout << '(' << x << "," << y << ") ";
    }
    cout << endl;
  }

}

