Thursday, 22 March 2018

Calculation of Area Perimeter and Diagonal of Rectangle


Public Class Form1
    Dim l, b, ar, per, diag As Single
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        l = TextBox1.Text
        b = TextBox2.Text
        ar = l * b
        per = 2 * (l + b)
        diag = (l ^ 2 + b ^ 2) ^ (1 / 2)
        TextBox3.Text = ar
        TextBox4.Text = per
        TextBox5.Text = diag
    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.