hooow thiiis programm can be done by the method of SUB-PROCEDURE????
Public Function fact(a As Integer)
Dim i As Integer
Dim f As Integer
f = 1
For i = 1 To a
f = f * i
Next
fact = f
End Function
Private Sub Command2_Click()
Dim a As Integer
a = InputBox("put values")
Print "factorial ="; fact(a)
End Sub