How does C# support functional programming

Functional Programming, C#, Lambda Expressions, LINQ, Delegates, Higher-Order Functions
C# supports functional programming through features such as lambda expressions, LINQ for querying data, and delegates to create anonymous methods, allowing for a functional style of programming alongside object-oriented principles.

// Example of a simple functional programming style in C#
using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main()
    {
        // List of numbers
        var numbers = new List { 1, 2, 3, 4, 5 };

        // Using LINQ to filter and project the numbers
        var squaredNumbers = numbers.Select(x => x * x).Where(x => x > 5);

        // Display the squares greater than 5
        foreach (var number in squaredNumbers)
        {
            Console.WriteLine(number);
        }
    }
}
    

Functional Programming C# Lambda Expressions LINQ Delegates Higher-Order Functions