Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

GATE | GATE CS 1997 | Question 68

  • Last Updated : 30 Oct, 2017

Consider the following program fragment in Pascal:

Program Main;
    var X : integer;
    procedure A:
       var Y : integer;
    procedure B:
       var Z : integer;
    procedure C:
       var Z : integer;
    begin(*Procedure C*)
    end(*Procedure C*)
 begin(*Procedure B*)
 C; (*call to C*)
 A; (*call to A*)

 end(*Procedure B*)
 begin(*Procedure A*)
        B; (*call to B*)
  end(*Procedure A*)
begin (*Main*)

Assume that there are no calls to any procedures other than the ones indicated above. It is known that at some point of time during the execution of this program five activation records exist on the run-time stack. Describe the run-time stack at this point of time by clearly indicating the following: the top of the stack, the contents of the static link and dynamic link, and allocation of the local variables in each record.



Quiz of this Question
Please comment below if you find anything wrong in the above post

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!