What does the following program do?

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

int mystery( int, int ); // function prototype

int main()
{
int x, y;

cout << "Enter two integers: ";
cin >> x >> y;
cout << "The result is " << mystery( x, y ) << endl;
} // end main

// Parameter b must be a positive integer to prevent infinite recursion
int mystery( int a, int b )
{
if ( b == 1 ) // base case
return a;
else // recursion step
return a + mystery( a, b - 1 );
} // end function mystery
```

This program multiplies two integers recursively.

Computer Science & Information Technology

You might also like to view...

Using good grammar, describe how you can determine how much memory to install in a system

What will be an ideal response?

Computer Science & Information Technology

Write a computer program to realize the fitness-based network evolution model. Estimate the time complexity to execute the program. Make necessary assumptions.

What will be an ideal response?

Computer Science & Information Technology