Question: Assuming dynamic scoping is being used, what would be the output of the program below? #include using namespace std; int c = 20; void fun1(int

Assuming dynamic scoping is being used, what would be the output of the program below?

#include  using namespace std; int c = 20; void fun1(int x) { int b = 5; x = x + c - b; c = c + 6; cout << x << " " << c << endl; } void fun2(int x) { int b = 3; int c = 4; x = x + bx = x + c - b; cout << x << " " << c << endl; fun1(x); } int main():= { int a = 8, b = 16; fun2(a) cout << x << " " << c << endl; return 0; } 

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!