Question: int a = 0 ; 2 int b = 0 ; 3 void print ( ) { 4 printf ( % d , %
int a ;
int b ;
void print
printf d d a b ;
int fun
int a c ;
a ; b ; c ;
print
return c ;
void fun int c
int a ;
a ; b c ;
print ;
int main
a fun;
fun;
print ;
return ;
Draw the symbol tables in separation for all scopes in this program. Assume each
table contains two columns: name and type.
What is the output of the above code with static scoping? Justify your answer by
showing the tree of the symbol tables.
What is the output of the above code with dynamic scoping? Justify your answer by
showing the tree of the symbol tables d
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
