Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Consider the following program in a Pascal-like language with statio scoping rules are applied: procedure main var i, j, k:integer; var a [3]:integer; procedure

image text in transcribed

2. Consider the following program in a Pascal-like language with statio scoping rules are applied: procedure main var i, j, k:integer; var a [3]:integer; procedure Q(m,n) var k : integer; begin {Q} k=1; n=m+1; m=m+4; print i, j. k,a[1],a[2]; end; {Q} procedure P(k,w) var i: integer; begin (P} I =0; y=k+w: w=j+k; print i, J, k, a [1], a[2]; Q(1, a [J]); end; {P} begin \{main\} 1=1;j=2;k=6;a[1]=5;a[2]=1 P(1, a []]); end. {main} What will be the output of the program with static scoping and if a) A.1 parameters are pass-by-reference, b) A11 parameters are pass-by-value, and c) A11 parameters are pass-by-value-result

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

Advances In Spatial And Temporal Databases 8th International Symposium Sstd 2003 Santorini Island Greece July 2003 Proceedings Lncs 2750

Authors: Thanasis Hadzilacos ,Yannis Manolopoulos ,John F. Roddick ,Yannis Theodoridis

2003rd Edition

3540405356, 978-3540405351

More Books

Students also viewed these Databases questions

Question

Does it use a maximum of two typefaces or fonts?

Answered: 1 week ago