//************************************** // Name: write days and months // Description:use DateTime type to show the days of week and months of year using for loop // By: hatem mostafa ahmed // // // Inputs:None // // Returns:None // //Assumes:None // //Side Effects:None //************************************** using System; public class Program { public static void Main() { Console.WriteLine("Hello World"); DateTime dt = Convert.ToDateTime("1/1/2000"); for(int x=1;x<=12;x++) { Console.WriteLine(dt.ToString("MMMM")); Console.WriteLine(dt.ToString("MMM")); dt=dt.AddMonths(1); } DateTime dt2 = Convert.ToDateTime("5/1/2010"); for(int x=1; x<=7; x++) { Console.WriteLine(dt.ToString("dddd")); dt=dt.AddDays(1); } } }