Sub addtwonum()
'this subprog adds two numbers (to single precision accuracy)
'
'declare variables for efficient use of computer resources
Dim sinNum1 As Single
Dim sinNum2 As Single
Dim sinTotal As Single
'
'input
'INPUT "Enter the first number .. " ; sinNum1 'qbasic
'INPUT "Enter another number .... " ; sinNum1 'qbasic
sinNum1 = InputBox("Enter the first number .. ") 'vba
sinNum2 = InputBox("Enter another number .... ") 'vba
'
'calculations
sinTotal = sinNum1 + sinNum2 'the algorithm
'
'output
'PRINT "The sum of the two numbers is .. " ; sinTotal 'qbasic
MsgBox "The sum of the two numbers is .. " & sinTotal 'vba
'
End Sub