Complete the code to declare a Func delegate that takes two integers and returns an integer.
Func<int, int, [1]> add = (x, y) => x + y;The Func delegate's last type parameter specifies the return type. Here, it returns an int.
Complete the code to declare a Func delegate that takes a string and returns its length.
Func<string, [1]> getLength = s => s.Length;The Func delegate returns the length of the string, which is an int.
Fix the error in the Func delegate declaration to correctly return a boolean indicating if a number is even.
Func<int, [1]> isEven = n => n % 2 == 0;
The lambda returns a boolean value, so the Func delegate must have bool as the return type.
Fill both blanks to declare a Func delegate that takes a double and an int, and returns a double result.
Func<[1], [2], double> multiply = (a, b) => a * b;
The Func delegate takes a double and an int as inputs and returns a double.
Fill all three blanks to declare a Func delegate that takes two strings and returns a boolean indicating if they are equal.
Func<[1], [2], [3]> areEqual = (s1, s2) => s1 == s2;
The Func delegate takes two string inputs and returns a bool indicating equality.