Domino Code Fragment

Code Name*
Factorial of n using iteration
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.149.233.104
Description*
Returns the factorial of a number n using iteration
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Public Function Factorial (n As Integer) As Long
    Dim fact As Integer
    If n <= 0 Then                  ' End the recursive calling chain.
         Factorial = 0
    Elseif n = 1 Then              ' End the recursive calling chain.
         Factorial = 1
    Else
         Factorial = 1
         For i = 1 To n
              Factorial = i *  Factorial
         Next i
    End If
End Function