Create a form with
2 text boxe , 1 Label , And 1 command button.
Label properties…………..
Label1 Caption- Year
Command buttons properties…………..
Command buttons 1 - Caption: Leap
year or not
Add the following code to the form code module for the Formr1
_Click event:
Program code:
Private Sub Command1_Click()
Dim x, y, z, year
year = Val(Text1)
x = year Mod 4
y = year Mod 100
z = year Mod 400
If ((x = 0 And Not (y = 0)) Or z = 0) Then
Text2 = "This is a leap year"
Else
Text2 = "This is not a leap year"
End If
End Sub
..........................................................
.....................................................
by Md. Sayemon
Thank you very much!!!!!
ReplyDeletethanks sir.......
ReplyDeleteThanks sir..........
ReplyDeleteThank sir i was in an exam it really worked
ReplyDelete