Question #329709

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

Expert's answer

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();
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS