VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Simple function to prompt a user for three numbers and take the average of them.

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.

Rate 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

Download this snippet    Add to My Saved Code

Simple function to prompt a user for three numbers and take the average of them. Comments

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..

Post your comment

Subject:
Message:
0/1000 characters