Thursday, 22 March 2018

Calculation of Area Perimeter and Diagonal of Square



Public Class Form1
    Dim s, ar, diag, per As String

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        s = TextBox1.Text
        ar = s * s
        per = 4 * s
        diag = (2 * (s ^ 2)) ^ (1 / 2)
        TextBox2.Text = ar
        TextBox3.Text = per
        TextBox4.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.