Question: 1 / / Ex . 7 . 2 1 : Ex 0 7 _ 2 1 . cpp 2 / / What does this program

1// Ex.7.21: Ex07_21.cpp
2// What does this program do?
3 #include
4 using namespace std;
5
6 void someFunction( int [], int, int ); // function prototype
7
8 int main()
9{
10 const int arraySize =10;
11 int a[ arraySize ]={1,2,3,4,5,6,7,8,9,10};
12
13 cout << "The values in the array are:" << endl;
14 someFunction( a,0, arraySize );
15 cout << endl;
16}// end main
17
18// What does this function do?
19 void someFunction( int b[], int current, int size )
20{
21 if ( current < size )
22{
23 someFunction( b, current +1, size );
24 cout << b[ current ]<<"";
25}// end if
26}// end function someFunction

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!