C# Sharp Exercises: Day of the week for a specified date
C# Sharp DateTime: Exercise-3 with Solution
Write a C# Sharp program to get the day of the week for a specified date.
Sample Solution:-
C# Sharp Code:
using System;
public class Example3
{
public static void Main()
{
// Assume the current system is en-US.
DateTime dt = new DateTime(2016, 7, 11);
Console.WriteLine("The day of the week for {0:d} is {1}.", dt, dt.DayOfWeek);
}
}
Sample Output:
The day of the week for 7/11/2016 is Monday.
Flowchart :

C# Sharp Code Editor:
Improve this sample solution and post your code through Disqus
Previous: Write a C# Sharp program to display the Day properties (year, month, day, hour, minute, second, millisecond etc.).
Next: Write a C# Sharp program to display the number of days of the year between two specified years.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Exercises: Weekly Top 12 Most Popular Topics
- Pandas DataFrame: Exercises, Practice, Solution
- Conversion Tools
- JavaScript: HTML Form Validation
- SQL Exercises, Practice, Solution - SUBQUERIES
- C Programming Exercises, Practice, Solution : For Loop
- Python Exercises, Practice, Solution
- Python Data Type: List - Exercises, Practice, Solution
- C++ Basic: Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - exercises on Employee Database
- SQL Exercises, Practice, Solution - exercises on Movie Database
- SQL Exercises, Practice, Solution - exercises on Soccer Database
- C Programming Exercises, Practice, Solution : Recursion