Question: :ctt (2 marks) 2.2) Write another program that can perform the same task. The program should be different from the one given in Figure

:ctt (2 marks) 2.2) Write another program that can perform the same task. The program should be different from the one given in Figure 2. *Copy and paste your program AND output. #include using namespace std; int Mystery(int array[], int a, int b); int main() { int a1,a2,d; int num[] = {17,0,-61,12,200,10,69,-55,77,123,-29); a1 = 0; a2 = sizeof(num)/sizeof(num[0])-1; d = Mystery (num,a1,a2); cout < < "The value of d is " < < d; return 0; int Mystery(int array[], int a, int b) { int c; if(a == b) else { } return array[a]; c = Mystery(array,a+1,b); if(array[a] >= c) return array[a]; else return c; Figure 2 (6 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
