// While2.cc #include using namespace std; int main() { int N = 10 ; int i ; i = 1 ; while ( i<=N ) { cout << i << " A " << endl; i ++ ; } cout << "after 'while (i<=10)', i=" << i << endl ; i = 1 ; do { cout << i << " B " << endl; i ++ ; } while ( i<=N ) ; cout << "after 'do..while (i<=10)', i=" << i << endl ; i = 100 ; while ( i<=N ) { cout << i << " C " << endl; i ++ ; } cout << "Now, i=" << i << endl ; i = 100 ; do { cout << i << " D " << endl; i ++ ; } while ( i<=N ) ; cout << "Now, i=" << i << endl ; }