Complete the code to create an expression-bodied lambda that adds two numbers.
Func<int, int, int> add = (x, y) => x [1] y;The expression-bodied lambda uses the '+' operator to add x and y.
Complete the code to create an expression-bodied lambda that returns the square of a number.
Func<int, int> square = x => x [1] x;The expression-bodied lambda uses the '*' operator to multiply x by itself, returning the square.
Fix the error in the expression-bodied lambda that returns true if a number is even.
Func<int, bool> isEven = x => x [1] 2 == 0;
The '%' operator gives the remainder. If x % 2 equals 0, x is even.
Fill both blanks to create an expression-bodied lambda that returns true if a string is longer than 5 characters.
Func<string, bool> isLong = s => s.[1] > [2];
The lambda uses the Length property to get the string length and compares it to 5.
Fill all three blanks to create an expression-bodied lambda that returns a dictionary with keys as uppercase strings and values as their lengths.
var result = [1].ToDictionary([2] => [2].ToUpper(), [3] => [3].Length);
The lambda uses the list 'words' and the parameter 'word' to create a dictionary with uppercase keys and length values.