static void UseParams() { var calculator = new Calculator(); Console.WriteLine(calculator.Add(1, 2)); Console.WriteLine(calculator.Add(1, 2, 3)); Console.WriteLine(calculator.Add(1, 2, 3, 4)); Console.WriteLine(calculator.Add(new int[] { 1, 2, 3, 4, 5 })); }
static void UseParams() { var calculator = new Calculator(); Console.WriteLine(calculator.Add(5, 4, 3, 2, 1)); Console.WriteLine(calculator.Add(2, 4, 6, 8, 10, 12, 14)); Console.WriteLine(calculator.Add(new int[] { 234, 4589, 27, 205, 374 })); }
static void UseCalc() { var calc = new Calculator(); Console.WriteLine(calc.Add(10, 20, 30)); }