Question: Given the code below and assuming STATIC SCOPING is used, which variable bindings would be visible within method B when called by method A? (i.e.,

Given the code below and assuming STATIC SCOPING is used, which variable bindings would be visible within method B when called by method A?

(i.e., main is called; then main calls A; then A calls B).

01 int h, i; 02 03 void B(int m) { 04 int j, k; 05 // what is visible HERE? 06 ... 07 } 08 09 void A(int j, int k) { 10 float h = j + k; 11 B(h); 12 ... 13 } 14 15 void main() { 16 int i, j; 17 18 A(h, i); 19 B(h); 20 ... 21 }

Select ALL that applies:

k from line 4

j from line 16

h from line 01

i from line 01

j from line 9

j from line 4

h from line 10

m from line 3

i from line 16

k from line 9

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 Databases Questions!