So I need to write an application that uses 2 listbox's.
The first listbox simply loads the values 1 - 20.
The list box next to it just shows the Factorial for each number in the listbox1.
This just happens when the form loads. While trying to figure out how to do this I can do :
This just gives me the factorial for the number 5. I can't figure out how to get it to list the factorial for 1, 2, 3, 4, & 5 in the listbox2.
The first listbox simply loads the values 1 - 20.
The list box next to it just shows the Factorial for each number in the listbox1.
This just happens when the form loads. While trying to figure out how to do this I can do :
VB.NET:
Dim factorial As Long = 1
For i As Long = 1 To 20
factorial = factorial * i
Next i
ListBox2.Items.Add(factorial)
This just gives me the factorial for the number 5. I can't figure out how to get it to list the factorial for 1, 2, 3, 4, & 5 in the listbox2.