Private Sub Form_click()
Dim x%,y%,s%,i%
x = Val(InputBox("x="))
y = Val(InputBox("y="))
For i = x To y
s = s + Fac(i)
Next
Print s
End Sub
Function Fac(n)
Dim i%
Fac = 1
For i = 1 To n
Fac = Fac * i
Next
End Function
Private Sub Form_click()
Dim x%,y%,s%,i%
x = Val(InputBox("x="))
y = Val(InputBox("y="))
For i = x To y
s = s + Fac(i)
Next
Print s
End Sub
Function Fac(n)
Dim i%
Fac = 1
For i = 1 To n
Fac = Fac * i
Next
End Function