int mystery(int list[], int first, int last){ if (first == last) return list[first]; else return list[first] + mystery(list, first + 1, last);}
Consider the accompanying definition of the recursive function mystery. Given the declaration:int beta[10] = {2, 5, 8, 9, 13, 15, 18, 20, 23, 25};What is the output of the following statement?cout << mystery(beta, 4, 7) << endl;
A. 27
B. 33
C. 55
D. 66
Answer: D
Computer Science & Information Technology
You might also like to view...
________ apps are programs that you can carry and run from a flash drive
Fill in the blank(s) with correct word
Computer Science & Information Technology
________ an image eliminates unwanted portions of the image
A) Trimming B) Cropping C) Clipping D) Snipping
Computer Science & Information Technology