// demonstrates use of break and continue // Mikhail Nesterenko // 1/29/2013 #include using std::cout; using std::endl; using std::cin; int main(){ const int start=5; // countdown start number // prints: 5, 4, 3, countdown aborted ... for(int i = start; i >=0; --i){ cout << i << ", "; if (i==3){ cout << "countdown aborted ...\n"; break; } } // prints: 5, 4, 3, 2, 1, 0, liftoff! for(int i = start; i >=0; --i){ cout << i << ", "; if(i > 0) continue; cout << "liftoff!\n"; } }