2 votes 2 votes output of program: void function(int); void main() { function(3); } void function(int num){ if(num>0) { function(--num); printf("%d",num); function(--num); } } will the argument num value be retained at all recursion levels? Programming in C programming-in-c recursion + – gate_forum asked Mar 16, 2017 edited Mar 17, 2017 by dd gate_forum 1.4k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 4 votes 4 votes output : $0120$ dd answered Mar 17, 2017 selected Mar 18, 2017 by 2018 dd comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes It might help U!!!!!! akash.dinkar12 answered Mar 17, 2017 akash.dinkar12 comment Share Follow See all 4 Comments See all 4 4 Comments reply Akriti sood commented Mar 17, 2017 reply Follow Share dun you think after func(1),num will be 0.so for all the upper func calls of func(2) and func(3),0 should be printed. i.e output should be 0 0 0 –1 votes –1 votes Akriti sood commented Mar 17, 2017 reply Follow Share oo sorry,i missed that num is not static. 0 votes 0 votes akash.dinkar12 commented Mar 17, 2017 reply Follow Share I m not getting......... 0 votes 0 votes akash.dinkar12 commented Mar 17, 2017 reply Follow Share ok.... 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes answer will be 0120 as u will expand it u got the ans akankshadewangan24 answered Apr 20, 2017 akankshadewangan24 comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Answer according to my method is 1213121. Ankit Wagh answered Nov 18, 2017 Ankit Wagh comment Share Follow See all 0 reply Please log in or register to add a comment.