Generation

generate functionWed, 23 Nov 2022

array of days of the months

static int[] MonthDays = new int[12] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static void Main(string[] args) { Console.WriteLine(GetDaysOfMonth(3)); } static int GetDaysOfMonth(int Month) { return MonthDays[Month]; }

Questions about programming?Chat with your personal AI assistant