GATEverse Practice, past papers & mock tests
GATE 2016 · CS2 - Afternoon
Programming & Data StructuresProgrammingeasyNAT2 marks
Consider the program:
c
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));
}
The value printed by this program is _______
Save your progress

Related Programming & Data Structures PYQs