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