Q:

Write a program in C# Sharp to get the day and month name of current date

0

Write a program in C# Sharp to get the day and month name of current date. 
Expected Output :

The current Month No. is : 9
 The current Month is : September

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

using System;

class dttimeex49

{
    static void Main()
    {
    Console.Write("\n\n Display the month no. and name for the current date :\n");
	Console.Write("---------------------------------------------------------\n");	        
	DateTime now = DateTime.Now;
	Console.WriteLine(" The current Month No. is : {0} ",now.Month);
	Console.WriteLine(" The current Month is : {0}\n",now.ToString("MMMM"));
    }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now