0 votes 0 votes The output of the program if dynamic scoping is used__? Somoshree Datta 5 asked Jan 11, 2019 Somoshree Datta 5 591 views answer comment Share Follow See all 11 Comments See all 11 11 Comments reply arya_stark commented Jan 11, 2019 reply Follow Share is 1187???? 0 votes 0 votes balraj_allam commented Jan 13, 2019 reply Follow Share 624? 0 votes 0 votes Shubhgupta commented Jan 13, 2019 reply Follow Share https://gateoverflow.in/293734/dynamic-programming-basics 1 votes 1 votes Somoshree Datta 5 commented Jan 14, 2019 reply Follow Share Shubhgupta the answer is 304 right? 0 votes 0 votes Shubhgupta commented Jan 14, 2019 reply Follow Share yes 0 votes 0 votes balraj_allam commented Jan 14, 2019 reply Follow Share @Somoshree Datta 5 please post the solution. 0 votes 0 votes gauravkc commented Jan 14, 2019 reply Follow Share @balraj_allam Everything is same. Only trick is while executing f3(), you update the x in the main to 100. Thus, when x=x+f1()+f2()+f3()+f1() is executed, x will be 100. Rest, if u calculate, f1 will return 26, f2 51, f3 100 and f1 as 27. 0 votes 0 votes himgta commented Jan 14, 2019 reply Follow Share @gauravkc @Shubhgupta then it should be 303..how 304? 0 votes 0 votes Shubhgupta commented Jan 14, 2019 reply Follow Share gaurav already explained this, @himgta where are you getting flaw in his explanation. 0 votes 0 votes gauravkc commented Jan 14, 2019 reply Follow Share 100+26+51+100+27 is 304 0 votes 0 votes himgta commented Jan 14, 2019 reply Follow Share ya ..I got it...f2() will return 51 ,I was putting 50 only! Thanks! 0 votes 0 votes Please log in or register to add a comment.