Question: [9 points] Consider the following program written in a language whose syntax similar to C and functions can be passed as arguments. The program
![[9 points] Consider the following program written in a language whose syntax](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2020/06/5ed7a09aa49ea_1591189657879.jpg)
[9 points] Consider the following program written in a language whose syntax similar to C and functions can be passed as arguments. The program starts with the main function. int a = 1; void f1(int x) { a = a+x; // global a declaration void f2(function fx) { int a = 2; fx(10); print (a); } void f3() { int a = 3; f2(f1); print(a); void main() { f3(); print (a); a) What will the program output if the language has deep binding? b) What will the program output if the language has shallow binding? ) What will the program output if the language has ad-hoc binding?
Step by Step Solution
3.44 Rating (157 Votes )
There are 3 Steps involved in it
To answer these questions we need to understand the concepts of deep binding shallow binding and adh... View full answer
Get step-by-step solutions from verified subject matter experts
