C Programming Syntax Error: Correcting Code for Fibonacci Sequence Calculation
There is a syntax error in the code. The return statement in the function is missing a closing parenthesis. It should be:
'return (fun(n-1) + fun(n-2));'
Also, the main function is missing opening and closing braces. It should be:
'int main(void) { printf('%ld\n', fun(6)); return 0; }'
With these corrections, the output of the program is:
12
Therefore, the answer is C) 12.
原文地址: https://www.cveoy.top/t/topic/opUY 著作权归作者所有。请勿转载和采集!