Feed Headline Animator

WAP to find the factorial by using next loop statements.

Private Sub Command1_Click()
Dim f As Long, n As Long, i As Long
n = InputBox("Enter as integer", "Factorial")
f = 1
For i = n To 1 Step -1
f = f * i
Next
MsgBox ("Factorial of " & n & "is" & f)
End Sub


Posted by: Wasim Javed

No comments:

Post a Comment