// // Filename: pgm2_8b.cpp // // Description: Demonstration of the continue statement! // // ENSC 104: Digital Computer Programming // // Instructor: Dr. Walsh // // Section: 2 // // Date Created: 02/23/98 // Last Modified: 02/23/98 // // Name: N/A // #include main() { int x; for ( x = 1; x <= 10; x++) { if (x == 5) continue; cout << x << " "; } cout << endl << "Continue in a 'for' loop." << endl << endl; x = 1; while( x <= 10 ) { if ( x == 5 ) { x++; continue; } cout << x << " "; x++; } cout << endl << "Continue in a 'while' loop." << endl << endl; x = 1; do { if ( x == 5 ) { x++; continue; } cout << x << " "; x++; } while ( x <= 10 ); cout << endl << "Continue in a 'do while' loop." << endl << endl; return 0; }