Action greet = () => Console.WriteLine("Hello!");
greet(); // Invoke the action
Func<int, int, int> add = (a, b) => a + b;
int result = add(5, 3); // Invoke the function
Console.WriteLine("Result: " + result);
Predicate<int> isEven = x => x % 2 == 0;
bool even = isEven(6); // Check if a number is even
Console.WriteLine("Is Even: " + even);
// Create an expression tree for an addition operation
Expression<Func<int, int, int>> addExpression = (a, b) => a + b;
// Compile and execute the expression tree
var addFunc = addExpression.Compile();
int result = addFunc(5, 3);
Console.WriteLine("Result: " + result);