static void Main(string[] args) { var generator = new FibonacciGenerator(); foreach (var digit in generator.Generate(15)) { Console.WriteLine(digit); } }
static void Main(string[] args) { var currentDate = DateTime.Now.NextYear(); var generator = new FibonacciGenerator(); foreach (var digit in generator.Generate(15)) { Console.WriteLine(digit); } }
// Adding `--` to the end of a dotnet command, anything after will be added as an argument, and will be stored in the first parameter of the `Main` method // When the application has been published, omit the `--` and just add the paramet directly at the end of the command static void Main(string[] args) { if (args.Length > 0) { try { var generator = new FibonacciGenerator(); foreach (var digit in generator.Generate(Int32.Parse(args[0]))) { Console.WriteLine(digit); } } catch (System.Exception) { Console.WriteLine("The parameter supplied is not of Number type."); } } else { Console.WriteLine("No parameters have been supplied, please add `-- <NUMBER>` to the end of the command"); } }
static void Main(string[] args) { if (args.Length > 0) { Console.WriteLine($"Hello {args[0]}!"); } else { Console.WriteLine("Hello!"); } Console.WriteLine("Fibonacci Numbers 1-15:"); // for(int i=0; i<15; i++) { // Console.WriteLine($"{i+1}: {FibonacciNumber(i)}"); // } var generator = new FibonacciGenerator(); foreach (var digit in generator.Generate(15)) { Console.WriteLine(digit); } }