Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

int a = 0 ; 2 int b = 0 ; 3 void print ( ) { 4 printf ( % d , %

int a =0;
2 int b =0;
3 void print (){
4 printf ("%d ,% d ", a , b );
5}
6
7 int fun1(){
8 int a , c ;
9 a =1; b =2; c =3;
10 print ()
11 return c ;
12}
13
14 void fun2( int c ){
15 int a ;
16 a =9; b = c ;
17 print ();
18}
19
20 int main (){
21 a = fun1();
22 fun2(8);
23 print ();
24 return 0;
25}
1. Draw the symbol tables in separation for all 5 scopes in this program. Assume each
table contains two columns: name and type.
2. What is the output of the above code with static scoping? Justify your answer by
showing the tree of the symbol tables.
3. What is the output of the above code with dynamic scoping? Justify your answer by
showing the tree of the symbol tables1 d

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

l Discuss the major factors influencing global HR management.

Answered: 1 week ago

Question

Why does sin 2x + cos2x =1 ?

Answered: 1 week ago

Question

What are DNA and RNA and what is the difference between them?

Answered: 1 week ago

Question

Why do living creatures die? Can it be proved that they are reborn?

Answered: 1 week ago

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago