using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace IO_lab03_zad04 { class Program { delegate int DelegateType(object arguments); static DelegateType delegateName; static int Fibonacci(object n) { int a = 0; int b = 1; int x = Convert.ToInt32(n); // In N steps compute Fibonacci sequence iteratively. for (int i = 0; i < x; i++) { int temp = a; a = b; b = temp + b; } return a; } static void Main(string[] args) { delegateName = new DelegateType(Fibonacci); IAsyncResult ar = delegateName.BeginInvoke(22, null, null); Console.Write(delegateName.EndInvoke(ar)); } } }