using System;
using System.Globalization;
using System.Collections.Generic;
public class LastFridaysOfYearProgram
{
// Return all last Fridays of each month in a given year
private static IEnumerable<DateTime> LastFridaysOfYear(int year) {
for (var month = 1; month <= 12; month++) {
// Last day of the month
var date = new DateTime(year, month, 1)
.AddMonths(1)
.AddDays(-1);
// Walk backward to Friday
while (date.DayOfWeek != DayOfWeek.Friday) {
date = date.AddDays(-1);
}
yield return date;
}
}
public static void Main(string[] args)
{
int year = (args.Length > 0)
? int.Parse(args[0])
: 2026;
foreach (var date in LastFridaysOfYear(year)) {
Console.WriteLine(date.ToString("d", CultureInfo.InvariantCulture));
}
}
}
/*
run:
01/30/2026
02/27/2026
03/27/2026
04/24/2026
05/29/2026
06/26/2026
07/31/2026
08/28/2026
09/25/2026
10/30/2026
11/27/2026
12/25/2026
*/