(e) int fun(int n, int *f_p) { int t, f; if (n <= 1) { *f_p= 3; return 1; }. t = fun(n-1, f_p); f=t+*f_p return f; } int

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

(e) int fun(int n, int *f_p) { int t, f; if (n <= 1) { *f_p= 3; return 1; }. t = fun(n-1, f_p); f=t+*f_p return f; } int

Post by answerhappygod »

E Int Fun Int N Int F P Int T F If N 1 F P 3 Return 1 T Fun N 1 F P F T F P Return F Int 1
E Int Fun Int N Int F P Int T F If N 1 F P 3 Return 1 T Fun N 1 F P F T F P Return F Int 1 (29.78 KiB) Viewed 30 times
What will be the output of this code? please explain how the output is coming!!
(e) int fun(int n, int *f_p) { int t, f; if (n <= 1) { *f_p= 3; return 1; }. t = fun(n-1, f_p); f=t+*f_p return f; } int main() { int x = 0; printf("%d\n", fun(4, &x)); return 0;
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply