53.1k views
3 votes
Consider the following definition of the recursive function mystery. 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;

User Tyrone
by
5.6k points

1 Answer

3 votes

Answer:

21

Step-by-step explanation:

User Ilia Ross
by
6.1k points