Question: In the following pseudo code, how many callback functions are used? delegate int MyDelegate(int a, int b); class MainApp { public static void Calculator(int a,

In the following pseudo code, how many callback functions are used?In the following pseudo code, how many callback functions are used? delegate

delegate int MyDelegate(int a, int b); class MainApp { public static void Calculator(int a, int b, MyDelegate d) { print(d(a,b)) } public static int add(int a, int b) { return a+b} public static int subtract(int a, int b) { return a-b} public static int multiply(int a, int b) { return a*b} static void Main() { MyDelegate Add = new MyDelegate(add) MyDelegate Subtract = new MyDelegate(subtract) MyDelegate Multiply = new MyDelegate(multiply) Calculator(3,4,Add) Calculator(3,4,SubTract) Calculator(3,4,Multiply) } }

1
2
3
4

In the following pseudo code, how many callback functions are used? delegate int MyDelegate(int a, int b) class MainApp public static void Calculator (int a, int b, MyDelegate d) t int b, MyDelegate d) print(d(a,b)) public static int add(int a, int b) return a+b) public static int subtract (int a, int b) t return a-b) public static int multiply(int a, int b) t return a-b static void Main) MyDelegate Add new MyDelegate(add) MyDelegate Subtract -new MyDelegate(subtract) MyDelegate Multiply- new MyDelegate(multiply) Calculator (3,4, Add) Calculator (3,4, SubTract) Calculator (3,4,Multiply) 0 1 0 2 03 0 4

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!