Thursday 30 August 2012

VB Program - To find out whether the given year is a leap year or not?

VB Program - To find out whether the given year is a leap year or not?

Program : 

Sub LeapYear()

Dim varYear
varYear = InputBox("Enter the Year")
If varYear Mod 4 = 0 Then
MsgBox varYear + " is a Leap year"
Else
MsgBox varYear + " is not a Leap year"
End If


End Sub

No comments:

Post a Comment