Trace the recursive solution you made to Self-Test Exercise 5.
What is the output of the following program?
#include
using namespace std;
int mystery(int n);
//Precondition n > = 1.
int main()
{
cout
return 0;
}
int mystery(int n)
if (n <>
return 1;
else
return ( mystery(n − 1) + n );
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here