using System; /* * Необязательные параметры методов */ class Program { /// /// Параметры по умолчанию всегда должны быть в конце списка /// /// # /// # /// Logging /// private static int Sum(int a, int b, bool enableLogging = false) { int result = a + b; if (enableLogging) { Console.WriteLine($"Значение переменной a = {a}"); Console.WriteLine($"Значение переменной b = {b}"); Console.WriteLine($"Значение переменной result = {result}"); } return result; } static void Main() { Sum(2, 3); Console.ReadKey(); } }