Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

CODIGOS USADOS EN FACTORIALES

Dim N As Long
Dim FACT As Long
Dim TEMP As Long
N = Val(NUM1.Text)
If N = 0 Then
NUM2.Text = Str(1)
Else
If N = 1 Then
NUM2.Text = Str(1)
Else
FACT = N
TEMP = FACT - 1
FACT = FACT * TEMP
While TEMP > 1
TEMP = TEMP - 1
FACT = FACT * TEMP
End While
If TEMP = 1 Then
NUM2.Text = Str(FACT)
End If
End If
End If
End Sub

DIAGRAMA DE FLUJOS

FACTORIAL

You might also like