by Tristan G. Mondia (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Fri 12th April 2002
Date Added: Mon 8th February 2021
Rating:
(1 Votes)
This program will calculate your age by asking the current year
API Declarations
Dim age As Integer
Dim input1 As String, input2 As Integer, input3 As Integer
End
End Sub
Private Sub cmdGo_Click()
input1 = InputBox("What is your name?:", "Name please...")
input2 = InputBox("What year were you born?:", "year please...")
input3 = InputBox("Enter current year:", "current year please...")
age = input3 - input2
lblDisplay.Caption = "You are " & input1 & " and you are " & age & " Years old"
End Sub
No comments have been posted about This program will calculate your age by asking the current year. Why not be the first to post a comment about This program will calculate your age by asking the current year.