894 views

1 Answer

0 votes
0 votes
answer is c

first time when the plus(25) is called then,in plus function x=25, but a is not defined .if this was static scoping then it would have taken value 10 of global variable,but since it is dynamic scoping so it will find a in the function which is stacked below this function which is main function so ,here a is 1 hence 26 will be printed.

then a =3 then again plus(a) is called here x=3 a=3 hence 6 will be printed

inc() will do nothing to a as a is not static it is local variable so a will be 3 and will print 3 .last plus(a) will print 6 similarly

Related questions

1 votes
1 votes
2 answers
1
3 votes
3 votes
2 answers
2
set2018 asked Oct 10, 2017
454 views
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();...