In: Computer Science
1. Consider the program below.
a. What would the output be in a language with static scoping rules? Explain your answer.
b. What would the output be in a language with dynamic scoping rules? Explain your answer.
int x; //global
int main() {
x = 11;
fun1();
fun2();
}
void fun1() {
int x = 19;
fun3();
}
void fun2() {
int x = 4;
fun3();
}
void fun3() {
print(x);
}