static void CheckFibonacci(NumberMethod method) { NumberMethod fib = method; bool running = true; Console.WriteLine("Input number n that is 0 or more. You will get the nth number of the fibonacci sequence. Input e to escape."); while (running) { string input = Console.ReadLine(); if (input[0] == 'e') { running = false; } else { Console.WriteLine(fib(int.Parse(input))); } } }
static void CheckEven(NumberMethod method) { NumberMethod even = method; bool running = true; Console.WriteLine("Input number n that is 0 or more. You will get the nth even number starting from 0. Type e to escape."); while (running) { string input = Console.ReadLine(); if (input[0] == 'e') { running = false; } else { Console.WriteLine(even(int.Parse(input))); } } }