Thursday, 22 March 2018

Calculation of Area and Perimeter of Triangle


Public Class Form1
    Dim a, b, c, per, ar, s As Single

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        a = TextBox1.Text
        b = TextBox2.Text
        c = TextBox3.Text
        per = a + b + c
        s = per / 2
        ar = (s * (s - a) * (s - b) * (s - c)) ^ (1 / 2)
        TextBox4.Text = per
        TextBox5.Text = ar
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class

No comments:

Post a Comment

Note: only a member of this blog may post a comment.