Public Sub Main()
Dim year As Integer = 2023 ' Specify the year
Dim dateValue As New DateTime(year, 1, 1) ' Start from the first day of the year
' Loop through all days of the year
While dateValue.Year = year
' Check if the day is Monday
If dateValue.DayOfWeek = DayOfWeek.Monday Then
Console.WriteLine(dateValue.ToString("yyyy-MM-dd")) ' Print the date
End If
dateValue = dateValue.AddDays(1) ' Move to the next day
End While
Console.ReadLine() ' Wait for user input before closing the console window
End Sub
Public Sub Main()
Dim year As Integer = 2024 ' Specify the year
Dim dateValue As New DateTime(year, 1, 1) ' Start from the first day of the year
' Loop through all days of the year
While dateValue.Year = year
' Check if the day is Monday
If dateValue.DayOfWeek = DayOfWeek.Monday Then
Console.WriteLine(dateValue.ToString("yyyy-MM-dd")) ' Print the date
End If
dateValue = dateValue.AddDays(1) ' Move to the next day
End While
Console.ReadLine() ' Wait for user input before closing the console window
End Sub