Public Class Form4
Dim a, b, c, e As Integer
Function potencia(ByVal b As Integer, ByVal e As Integer) As Integer
If e = 0 Then
Return 1
End If
Return b
Else
Return b * potencia(b, e - 1)
End If
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
a = TextBox1.Text
c = TextBox2.Text
Dim d As Integer = potencia(a, c)
Label2.Text = d
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Form5.Show()
End Sub
End Class

No hay comentarios:
Publicar un comentario