//--------------------------------------------------------------- // // r3.cpp // // Another example of a recursive function: countdown // // Written by: Simon Parsons // Date: 28th November 2007 // #include using namespace std; void countDown (int n) { if ( n <= 0 ) cout << "Blastoff!" << endl; else { cout << "Time to launch is " << n << " seconds" << endl; countDown(n - 1); } } // end of countdown() int main() { countDown(10); }