...
Question 7951 – Programming
December 8, 2023
Question 1255 – Data-Structures
December 8, 2023
Question 7951 – Programming
December 8, 2023
Question 1255 – Data-Structures
December 8, 2023

Question 8139 – Programming

Consider the following program:

    int f(int *p, int n)
    {
       if (n <= 1) return 0;
       else return max (f(p+1,n-1),p[0]-p[1]);
    }

    int main()
    {
       int a[] = {3,5,2,6,4};
       printf("%d", f(a,5));
    }

Note: max(x,y) returns the maximum of x and y.

The value printed by this program is __________.

Correct Answer: A

Question 15 Explanation: 
Given

f(a, 5) ⇒ f(100, 5)
A
3
B
4
C
5
D
6
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!