What does the following program do?

```
// Ex07_17.cpp
// What does this program do?
#include
#include
using namespace std;
const size_t arraySize{10};
int whatIsThis(const array&, size_t); // prototype
int main() {
array a{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int result{whatIsThis(a, arraySize)};

cout << "Result is " << result << endl;
}
// What does this function do?
int whatIsThis(const array& b, size_t size) {
if (size == 1) { // base case
return b[0];
}
else { // recursive step
return b[size - 1] + whatIsThis(b, size - 1);
}
}
```

This program sums array elements. The output would be
Result is 55

Computer Science & Information Technology

You might also like to view...

To insert a line break hold down the ________ key and press the Enter key

A) Ctl B) Tab C) Alt D) Shift

Computer Science & Information Technology

If a field is shortened after being populated, the danger is that some information might be "cut off" or ________

Fill in the blank(s) with correct word

Computer Science & Information Technology