Write a C# Sharp program to determine the day of the week 40 days after the current date

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

Write a C# Sharp program to determine the day of the week 40 days after the current date. 

Expected Output :

Today: Saturday                                                         
40 days from today: Thursday

الأجوبة

using System;
public class Example10
{
   public static void Main()
   {
      // Calculate what day of the week is 40 days from this instant.
    	DateTime today = DateTime.Now;
		DateTime answer = today.AddDays(40);
        Console.WriteLine("Today: {0:dddd}", today);
        Console.WriteLine("40 days from today: {0:dddd}", answer);
   }
}
هل كان المحتوى مفيد؟

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

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