Domino Code Fragment

Code Name*
Factorial of n using iteration
Date*
06/28/2025
Source (or email address if you prefer)*
[email protected]
IP address:.172.69.7.75
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