Question: Using C + + int mystery ( int first, int last ) { if ( first > last ) return 0 ; else if (

Using C++ int mystery(int first, int last)
{
if (first > last)
return 0;
else if (first == last)
return first;
else
return first + mystery(first +1, last -1);
}
What is the output of the following statement?
cout << mystery(6,10)<< endl;
Group of answer choices
13
21
40
42

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!