C# Lambda expressions Edit
Introduction
Lambda expressions are used to create an anonymous function. Lambda Expressions are two types
- Expression lambda
- Statement lambda
Syntax
- Expression lambda
(input-parameters) => expression
(input-parameters) => {}
Example
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Hello_World { class Program { public delegate void nameing(string name); static public void Main() { Funcsquare = x => x * x; Console.WriteLine("\n\n\t\t" square(7)); Console.ReadLine(); } } }