hi
I need a little helpI'm doing some work for a class at college, I need to work out the factorial of a number entered in a text box, by using a for loop. I can't use any functions. I'm really not very good at maths
I'd really appreciate it if you could offer me any help
Thanks in advance
- Robert
Edit -
I figured out how to do it. Couldn't believe how easy it is
VB Code:
Private Sub cmdCalculate_Click() intNumberInput = Val(txtNumberInput.Text) intResult = 1 For i = intNumberInput To 1 Step -1 intResult = intResult * i Next i lblResult.Caption = intResult End Sub
Thanks anyway!
- Robert




I'm doing some work for a class at college, I need to work out the factorial of a number entered in a text box, by using a for loop. I can't use any functions. I'm really not very good at maths 

Reply With Quote