Question: consider the following code snippet from a language that allows nested subroutines (5 points each): main program int m, n; procedure warriors () {
consider the following code snippet from a language that allows nested subroutines (5 points each): main program int m, n; procedure warriors () { m = m+2; println("from Warriors: n = + n); } " println("from Warriors: m = + m); procedure lakers (int m) I println("from Lakers: n = + n); warriors (); } m = 4; n = 14; println("from main: n = " + n); lakers (7); warriors(); 24. What will this program print, assuming static scoping? 25. What will this program print, assuming dynamic scoping?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
