Imports System
Public Class GetTheNext15LeapYears_VB_NET
Public Shared Function isLearYear(ByVal year As Integer) As Boolean
Return year Mod 4 = 0 AndAlso (year Mod 100 <> 0 OrElse year Mod 400 = 0)
End Function
Public Shared Sub Main(ByVal args As String())
Dim year As Integer = 2021, count As Integer = 0
While count < 15
If isLearYear(year) Then
count += 1
Console.WriteLine(year)
End If
year += 1
End While
End Sub
End Class
' run:
'
' 2024
' 2028
' 2032
' 2036
' 2040
' 2044
' 2048
' 2052
' 2056
' 2060
' 2064
' 2068
' 2072
' 2076
' 2080
'