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

  • برمجة سي شارب
  • برمجة

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

الأجوبة

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"));
    }
}
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...