using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public delegate double doubleDelegate(double w,double h);
namespace delegateSimpleExample
{
public class delegateClass
{
public static double getArea(double w,double h)
{
return w*h*0.5;
}
}
public class delegateSimpleExampleDemo
{
public static void Main(String[] args)
{
Console.WriteLine("C# code to demonstrate delegate");
doubleDelegate delegateObject = new doubleDelegate(delegateClass.getArea);
Console.WrileLine("Area of Triangle is : " + delegateObject(15,20));
Console.ReadLine();
}
}
}