VB过程的递归调用,求4的阶乘

VB过程的递归调用,求4的阶乘

'过程的递归调用,求4的阶乘
Private Function fact(n As Integer) As Integer
    If n = 1 Then
        fact = 1
    Else
        fact = n * fact(n - 1)
    End If
End Function
Private Sub Command1_Click()
    Dim n As Integer
    n = 4
    Print fact(n)
End Sub

在这里插入图片描述