by Brandon (46 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 22nd December 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Simple function to prompt a user for three numbers and take the average of them.
'function to calculate the average of 3 numbers
Const CountofNum = 3
Dim Sum, intNum As Long
Dim intCount As Integer
Sum = 0
For intCount = 1 To CountofNum Step 1
intNum = InputBox("Enter a number", "Value")
Sum = Sum + intNum
Next intCount
MyAverage = Format(Sum / CountofNum, "Fixed")
End Function
No comments have been posted about Simple function to prompt a user for three numbers and take the average of them.. Why not be the first to post a comment about Simple function to prompt a user for three numbers and take the average of them..