This document describes a program that calculates the square of a number. The program takes a number from a text box, multiplies it by itself to calculate the square, and displays the result in a second text box. It also includes buttons to clear the text boxes so new numbers can be entered.
This document describes a program that calculates the square of a number. The program takes a number from a text box, multiplies it by itself to calculate the square, and displays the result in a second text box. It also includes buttons to clear the text boxes so new numbers can be entered.
This document describes a program that calculates the square of a number. The program takes a number from a text box, multiplies it by itself to calculate the square, and displays the result in a second text box. It also includes buttons to clear the text boxes so new numbers can be entered.
Dim num As Integer Dim cuadrado As Integer Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click num = TextBox1.Text cuadrado = TextBox1.Text * TextBox1.Text TextBox2.Text = cuadrado End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" End Sub End Class