I need to print out the days where it is Friday the 13th next year.
What would be a good way to do that, currently I have a loop that goes through the days in between 1/1/2019 and 12/31/2019 from this question: How do you iterate through every day of the year? however I do not know how to check if a day is a friday the 13th.
Please help.
My code:
using System;
class Program
{
static void Main(string[] args)
{
DateTime date = new DateTime(2019,01,01);
DateTime end = new DateTime(2019,12,31);
for(; date <= end; date = date.AddDays(1))
{
Console.WriteLine(date.ToString());
}
}
}