static int year = new int();
static int month = new int();
static int[,] calendar = new int[6, 7];
public static void Main(string[] args)
Console.Write("Enter the year? ");
year = Convert.ToInt32(Console.ReadLine());
Console.Write("Enter the month (January = 1, etc): ");
month = Convert.ToInt32(Console.ReadLine());
public static void DrawHeader()
Console.WriteLine("\t" + month);
Console.WriteLine("Mo Tu We Th Fr Sa Su");
public static void FillCalendar()
int days = DateTime.DaysInMonth(year, month);
for (int i = 0; i < calendar.GetLength(0); i++)
for (int j = 0; j < calendar.GetLength(1) && currentDay <= days; j++)
calendar[i, j] = currentDay;
public static void DrawCalendar()
for (int i = 0; i < calendar.GetLength(0); i++)
for (int j = 0; j < calendar.GetLength(1); j++)
Console.Write(" " + calendar[i, j] + " ");
Console.Write(calendar[i, j] + " ");