//************************************** // Name: random date // Description:learn how to generate random numbers and use that to create random date // 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"); Random rnd = new Random(); int d =rnd.Next(1,13); int m = rnd.Next(1,31); int year = rnd.Next(2000,2019); DateTime dayR; dayR= Convert.ToDateTime(d+"-"+m+"-"+year); Console.WriteLine(dayR.ToString("dd-MMMM-yyyy")); } }