Q:

Write a C# Sharp program to calculate what day of the week is 40 days from this moment

0

Write a C# Sharp program to calculate what day of the week is 40 days from this moment. 

Expected Output :

Today = 8/20/2016 4:18:17 PM                                            
Thursday 

All Answers

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

using System;
public class Example9
{
   public static void Main()
   {
      
    System.DateTime today = System.DateTime.Now;
    System.Console.WriteLine("Today = "+System.DateTime.Now);
    System.TimeSpan duration = new System.TimeSpan(40, 0, 0, 0);
    System.DateTime answer = today.Add(duration);
    System.Console.WriteLine("{0:dddd}", answer);
   }
}

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