WAP to print the factorial of any number.
___________________________________
Private Sub Command1_Click()
a = Val(Text1.Text)
Call fact(a)
End Sub
Private Sub Command2_Click()
End
End Sub
Public Function fact(a)
If a = 0 Then
fact = 1
Text2.Text = fact
Else
fact = a * fact(a - 1)
Text2.Text = fact
End If
End Function
Private Sub Form_Load()
End Sub
_____________________________________
OUTPUT
_____________________________________
____________________________________
DOWNLOAD
____________________________________
Download its form
Download its Image
No comments:
Post a Comment