Day of the week: Difference between revisions

Content added Content deleted
(fixed)
Line 168: Line 168:


=={{header|C sharp|C#}}==
=={{header|C sharp|C#}}==
<lang csharp>using System;

class Program
{
static void Main(string[] args)
{
for (int i = 2008; i <= 2121; i++)
{
DateTime date = new DateTime(i, 12, 25);

if (date.DayOfWeek == DayOfWeek.Sunday)
{
Console.WriteLine(date.ToString("dd MMM yyyy"));
}
}

}
}</lang>

Using LINQ:


<lang csharp>using System;
<lang csharp>using System;