// loop1.cpp // Test program showing a simple for loop // Illustrates loop variables undefined after the loop // 1/28/03, Ray S. Babcock // #include using namespace std; int main(void) { int i=-9; for(int i=0; i<10; i++) cout << i << " "; cout << endl; cout << "after the loop, i = " << i << endl; for(int i=0; i<10; i++) cout << i << " "; cout << endl; cout << "after the second loop, i = " << i << endl; }