Test #6

Fri DEC 4, 1998

C++ How to Program, by H. M. Deitel and P. J. Deitel

Teacher: Dr. B.J. Shrestha

What does the following program do?

#include <iostream.h> void myFunction( int [], int ); int main() { const int arraySize = 5; int a[ arraySize ] = { 1, 3, 5, 7, 9}; cout << "The values in the array are: " << endl; myFunction( a, arraySize ); cout << endl; return 0; } void myFunction( int b[], int size ) { if ( size > 0 ) { myFunction( &b[ 1 ], size - 1 ); cout << b[ 0 ] << " "; } }