using System; class Program { static void Main(string[] args) { // Get the product name from the user Console.WriteLine("Enter the product name: "); string productName = Console.ReadLine(); // Get the expire date from the user Console.WriteLine("Enter the expire date (MM/DD/YYYY): "); DateTime expireDate = DateTime.ParseExact(Console.ReadLine(), "MM/dd/yyyy", null); // Calculate the remaining time TimeSpan remainingTime = expireDate - DateTime.Now; // Check if the product has expired if (remainingTime.TotalSeconds < 0) { Console.WriteLine("The {0} has expired.", productName); } else { // Calculate the remaining time in days int remainingDays = (int)remainingTime.TotalDays; // Display the remaining time Console.WriteLine("The {0} will expire in {1} days.", productName, remainingDays); // Display the date/time value in long date format Console.WriteLine("Long date format: {0}", expireDate.ToLongDateString()); // Display the date/time value in short date format Console.WriteLine("Short date format: {0}", expireDate.ToShortDateString()); // Display the date/time value in custom format with three-letter day, months, and four-digit year Console.WriteLine("Custom format: {0}", expireDate.ToString("ddd MMM yyyy")); } // Wait for the user to press a key before exiting Console.ReadLine(); } }