Question

Consider the following C code snippet:         #include     int recursiveSum(int
n) {         static int sum = 0; // Static variable         if (n > 0) {             sum += n;             recursiveSum(n - 1);         }         return sum;     }     int main() {         printf("First call: %d\n", recursiveSum(3));         printf("Second call: %d\n", recursiveSum(2));         return 0;     }     What will be the output of the main function?

A First call: 6 Second call: 9
B First call: 6 Second call: 3
C First call: 6 Second call: 6
D First call: 3 Second call: 2
E First call: 0 Second call: 0
Practice Next

Hey! Ask a query