17 lines
379 B
Plaintext
17 lines
379 B
Plaintext
|
<%
|
||
|
Function Factorial(ByVal intNumber)
|
||
|
If intNumber <= 1 Then
|
||
|
Factorial = 1
|
||
|
Else
|
||
|
Factorial = intNumber * Factorial(intNumber - 1)
|
||
|
End If
|
||
|
End Function
|
||
|
%>
|
||
|
|
||
|
And here we test the function with 2 values 5 and then 10
|
||
|
|
||
|
<%
|
||
|
Response.Write ("Factorial of 5 is " & Factorial(5))
|
||
|
Response.Write ("<br>")
|
||
|
Response.Write ("Factorial of 7 is " & Factorial(7))
|
||
|
%>
|