Public Class Form1
Inherits System.Windows.Forms.Form
 

Dim first, second, third As Double
Dim avg As Double
 

Function readnumbers()
first = TextBox1.Text
Second = TextBox2.Text
third = TextBox3.Text
End Function

Function printall(ByVal sum)
MsgBox(first & vbNewLine & second & vbNewLine & third)
MsgBox("First Number is" & first & vbNewLine & "Second Number is " & second & vbNewLine & "Third Number is " & third & vbNewLine & " the Sum is " & SUM)
TextBox4.Text = avg
End Function
 

Function findsum()
findsum = first + second + third
End Function
 

Function findavg(ByVal sum)
avg = sum / 3
End Function

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim sum As Double
readnumbers()
sum = findsum()
findavg(sum)
printall(sum)

End Sub
End Class

 

Hosted by www.Geocities.ws

1