write a program that enters an 8-digit string for a birthdate. The first two digits in the string are the month of birth, the next two are the day and the remaining four are the year in
internal class Program
{
static void Main()
{
Console.Write("Enter date: ");
string date = Console.ReadLine();
Console.WriteLine($"Month of birth: {date.Substring(0,2)}");
Console.WriteLine($"Day of birth: {date.Substring(2,2)}");
Console.WriteLine($"Year of birth: {date.Substring(4,4)}");
Console.ReadKey();
}
}
Comments
Leave a comment