|What is meant by "user-defined function"? Do you mean user input?|
Please define this using known math symbols "n!?k!". I do not know what a ? is mathematically.
As far as doing factorials in basic you do them like...
' Initialize the variables
Dim counter As Integer : counter = 5
Dim factorial As Long : factorial = 1
Do While counter > 0
factorial = factorial * counter ' Multiply
counter = counter - 1 ' Decrement
Print factorial ' Prints out the result.