Feed Headline Animator

WAP to find factorial of a given number.

Private Sub Command1_Click()
Dim f As Long, n As Long
n = InputBox("enter as integer", "Factorial")
f = 1
Do While n > 1
f = f * n
n = n - 1
Loop
MsgBox ("Factorial of the integer is " & f)
End Sub


Posted by: Wasim Javed

No comments:

Post a Comment