Professional Documents
Culture Documents
Entradas y Salidas COD
Entradas y Salidas COD
'------------------------------------------------------------------------
Dim N As Double
Dim Fact As Double
Dim Cont As Double
N = CStr(FactorialF_F.TxtN)
Fact = 1
If N = 0 Then
N=N+1
Fact = N
FactorialF_F.TxtFactorial.Text = CStr(Fact)
Else
If N > 0 Then
For Cont = 1 To N
Fact = Fact * Cont
FactorialF_F.TxtFactorial.Text = CStr(Fact)
Next
Else
FactorialF_F.TxtFactorial.Text = " No hay Factorial de un numero negativo "
End If
End If
End Sub
Private Sub CmdLimpiar_Click()
FactorialF_F.TxtFactorial.Text = ""
FactorialF_F.TxtN.Text = ""
End Sub
Input #1, N
Fact = 1
If N = 0 Then
N=N+1
Fact = N
Print #2, ""
Print #2, "Factorial"
Print #2, Fact
Else
If N > 0 Then
For Cont = 1 To N
Fact = Fact * Cont
Print #2, ""
Print #2, "Factorial"
Print #2, Fact
Next
Else
End If
Close #1
Close #2
FactorialA_A.TxtFin.Text = "Empece a calcular"
End Sub
Else
If N > 0 Then
For Cont = 1 To N
Fact = Fact * Cont
Reporte.Print Fact
Next
Else
End Sub
End Sub