I haven't coded in QBasic in
years, but in VB it would be like the following:
Dim intNumber As Integer
Dim lngFactorial As Long
Dim lngCounter As Long
intNumber = 5
For lngCounter = 1 To intNumber
lngFactorial = lngFactorial * lngCounter
Next lngCounter
"lngFactorial" would then be your number. Is this what you're looking for?