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...

To delete the character to the left of the insertion point, press the _____ key.

A. Backspace B. Tab C. Esc D. Delete

Computer Science & Information Technology

You can open the Brush window by pressing the ____ shortcut key.

a. F1 b. F2 c. F5 d. F8

Computer Science & Information Technology

A(n) ________ hard disk is typically connected to a USB or Thunderbolt port.

A. ethernet B. cloud C. external D. internal

Computer Science & Information Technology

Which of the following cloud services allows developers to create, test, and run solutions on a cloud platform without having to purchase the underlying hardware and software?

A. IaaS B. SaaS C. DaaS D. PaaS

Computer Science & Information Technology