how to use lambda expression

Gow.Net
Posted by Gow.Net under C# category on | Points: 40 | Views : 1737
 delegate int expression(int x );
static void Main(string[] args)
{
int z;
Console.WriteLine("Enter number:");
z =Convert.ToInt32( Console.ReadLine());
expression objx = x => x * x; //=> lambda expression "goes to"
int j = objx(z);
Console.WriteLine(j);
}

Comments or Responses

Login to post response