1 votes 1 votes #include <stdio.h> void f(int); int main() { int a=4; f(a); return 0; } void f(int n) { if(n>0) { f(--n); printf("%d", n); f(--n); } } Explain how function calls take place Programming in C programming-in-c recursion + – just_bhavana asked Jun 23, 2017 retagged May 20, 2021 by Shiva Sagar Rao just_bhavana 1.2k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 2 votes 2 votes draw the recursion tree pawan kumarln answered Jun 24, 2017 selected Aug 4, 2017 by just_bhavana pawan kumarln comment Share Follow See all 2 Comments See all 2 2 Comments reply shraddhatiwary commented Jun 30, 2017 reply Follow Share Sir... plz explain how to draw the recursion tree 0 votes 0 votes pawan kumarln commented Jul 1, 2017 reply Follow Share @ shraddhatiwary i m not sir ,,,i m GATE aspirant like u in this f(n) function call if(n>0) { 1.f(--n); 2.printf("%d", n); 3.f(--n); } ie when n>0 u have to execute these 3 line of code in recurssive manner 0 votes 0 votes Please log in or register to add a comment.
2 votes 2 votes 0120301 ? joshi_nitish answered Jun 23, 2017 joshi_nitish comment Share Follow See all 2 Comments See all 2 2 Comments reply srestha commented Jun 23, 2017 reply Follow Share yes, elaborate plz 0 votes 0 votes joshi_nitish commented Jun 23, 2017 reply Follow Share just make the recursion tree...you need not expand tree for each calls becoz many calls are redundant ..use the concept of dynamic programming 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes 0120301 you need to explain each recursive call just make a tree navya n answered Sep 14, 2017 navya n comment Share Follow See all 0 reply Please log in or register to add a comment.