3 votes 3 votes int i=10; main() { int i =5,k,i=6; printf("enter value"); scanf("%d",&k); if(k>0) { fun1(); } else { fun2(); } } void fun1(); { printf("%d",i); } void fun2(); { int i=5; printf("%d",i); fun1(); } what will the output using dynamic scoping? Programming in C programming dynamic-scoping + – set2018 asked Oct 10, 2017 set2018 454 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes by taking any value of k (k>0 ) OUTPUT will be 6 and if we take k=0 then , OUTPUT will be 5 5 Aiman answered Oct 10, 2017 Aiman comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Case 1:Suppose K is 10 then f1 calls It will print 10 because value is not passed Case 2:suppose K is -2 Then f2 calls in this case 5 10 prints as output Rishi yadav answered Oct 11, 2017 Rishi yadav comment Share Follow See all 0 reply Please log in or register to add a comment.