Descarga

Anuncio
DEBER DE MODULOS CASE
*FACTORIAL DE UN # CON LA ESTRUCTURA DO WHILE
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim i, j, f, s, n As Integer
n = TextBox1.Text
s = 0
Do While i <= n
j = 1
f = 1
Do While j <= i
f = f * j
j = j + 1
Loop
s = s + f
i = i + 1
Loop
TextBox2.Text = s
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button2.Click
TextBox1.Text = " "
TextBox2.Text = " "
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button3.Click
End
End Sub
End Class
*DETERMINAR EL N TERMINO DE LOS FIBONACCI
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim a, b, c, i, n As Integer
n = TextBox1.Text
a = 0
b = 1
i = 3
Do While i <= n
c = a + b
a = b
b = c
i = i + 1
Loop
TextBox2.Text = c
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button2.Click
TextBox1.Text = " "
TextBox2.Text = " "
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button3.Click
End
End Sub
End Class
Descargar