I'm new using Visual Basic, so I need help.
If I input "14" into the textbox, i want to have a list that will say:
1 2 3 4 5 . . . 14
I have a counter in my program, but I have no clue how to use it correctly. Please give me the code to bump up the count to display the list above.
Secondly, I want to create "Do-While Loop" that will give me the cubes of the numbers.
1 1 2 8 3 27 4 64 5 125 . . . 14 2744
I'm currently stuck, and I am not familiar with the code VB.
This is what I have so far:
Dim Product1 As Integer ' Is the list for the numbers: 1 2 3 4 5 6 7 8 etc Dim Product3 As Integer ' is the list for the cubes of the numbers Dim Max As Integer Dim Counter As Integer lstProduct3.Items.Clear() Max = txtnumber.Text Product1 = txtnumber.Text Do While Product1 < 15 Product3 = Product1 * 3 lstProduct3.Items.Add(Product3) If Product1 > 15 Then Exit Do End If Loop Exit Sub End Sub
Edited 3 Years Ago by mike_2000_17: Fixed formatting