Skip to content

Instantly share code, notes, and snippets.

@maacpiash
Created April 19, 2019 13:01
Show Gist options
  • Save maacpiash/b889f4abd7f21b13f6cb06ac598c1e6c to your computer and use it in GitHub Desktop.
Save maacpiash/b889f4abd7f21b13f6cb06ac598c1e6c to your computer and use it in GitHub Desktop.
using System;
namespace DelegateMath
{
class Program
{
static void Main(string[] args)
{
PrintResult(Multiply, 5, 12);
}
delegate double Take2intReturn1int(int a, int b);
static double Multiply(int x, int y) => x * y;
static void PrintResult(Take2intReturn1int func, int p, int q)
=> Console.WriteLine(func(p, q));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment