Answer to Question #329709 in C# for madhu

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

1
Expert's answer
2022-04-17T11:03:39-0400
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS