What does the following program do?

```
// What does this program do?
#include
using namespace std;

int whatIsThis( int [], int ); // function prototype

int main()
{
const int arraySize = 10;
int a[ arraySize ] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

int result = whatIsThis( a, arraySize );

cout << "Result is " << result << endl;
} // end main

// What does this function do?
int whatIsThis( int b[], int size )
{
if ( size == 1 ) // base case
return b[ 0 ];
else // recursive step
return b[ size - 1 ] + whatIsThis( b, size - 1 );
} // end function whatIsThis
```

This program sums array elements. The output would be

Computer Science & Information Technology

You might also like to view...

A blue ________ arrow shows the relationship between the active cell and its related cells

Fill in the blank(s) with correct word

Computer Science & Information Technology

You should add the static keyword in the place of ? in Line ________ in the following code:

``` public class Test { private int age; public ? int square(int n) { return n * n; } public ? int getAge() { } } ``` a. in line 4 b. in line 8 c. in both line 4 and line 8 d. none

Computer Science & Information Technology