Question: Assume static scoping PROGRAM EX 1 ; int i; / / global int A [ 3 ] ; / / global { array starts at

Assume static scoping PROGRAM EX1; int i; // global int A[3]; // global {array starts at 1} PROCEDURE P1( int x, int y) BEGIN y :=2; i :=3; END; BEGIN //main A[1]:=6; A[2]:=12; A[3]:=11; i :=2; P1(A[i], i); // first call PRINT(i)// #1 prints value of i PRINT_A(A); // #2 assume function that prints all the values found in the array A i :=1; P1(i, A[i]); // second call PRINT(i)// #3 prints value of i PRINT_A(A); // #4 assume function that prints all the values found in the array A END. Assume x is passed by Name and y is passed by Reference. Q12(2 pts) : #1 : a)3 b)4 c)2 d) None of the others Q13(2 pts) : #2: a)61212 b)61211 c)21112 d) None of the others Q14(2 Pts) : #3: a)3 b)4 c)2 d) None of the others

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!