Visual Basic 6.0 Guide
Loops - Tasks
1. Write a program that asks the user to input 2 numbers. Your program should then display all of the numbers from the lowest number to the highest.
Decide whether to use text boxes to do this or whether you want to use the InputBox function that you used in the Working With Variables section.
You can also use an IF statement to work out which of the two numbers is the higher.
2. Write a program that asks the user to input a phrase and a number. You program should display that phrase the number of times specified, showing the number and the phrase on each line.
3. You can write loops inside loops. This is called a nested loop. For example,
For intLoop1 = 1 To 3
For intLoop2 = 1 To 3
Print "Outer Loop " & intLoop1
Print "Inner Loop " & intLoop2
Try this example and study the results.
Use a similar technique to make a program that displays all of the multiplication tables from 2 to 12 in a multiline text box.