trabajo de modulos case

Anuncio
TRABAJO DE MODULOS CASE
POR: Ronny Nilve
CURSO: 6TO “ G”
CALCULAR LA SERIE DE FBONACCI DE UN NUMERO N
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim n, a, b, i, c As Integer
n = TextBox1.Text
a = 0
b = 1
i = 2
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
CALCULAR EL FACTORIAL DE UN NUMERO
Public Class Form1
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Dim i, n, s, f, j As Integer
n = TextBox1.Text
i = 1
j = 1
f = 1
Do While (i <= n)
Do While (j <= i)
f = f * i
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 Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
End
End Sub
End Class
Descargar