Question: Given the following: #include #include using namespace std; int tryThis ( int value ) ; int main ( void ) { cout < < tryThis

Given the following:
#include
#include
using namespace std;
int tryThis(int value);
int main (void){
cout << tryThis(10)<< endl;
return EXIT_SUCCESS;
}
int tryThis (int number){
int returnVal;
if (number ==1){
returnVal =4;
}
else {
returnVal = number *3+ tryThis(number -1);
}
return returnVal;
}
Questions:
What is the output from the above?
How many calls to tryThis were made?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!