For each (number) ?


How to use the above program statement?
What is the output of the above program?


"Number", what value is it?

What do you find in Label1.Text after you run this?
I'm guessing 9, the last value of number that fits into the range 1 to 10.

1 Like

A for loop is used to perform a specific operation a many number of times.
Eg: You want to add all the numbers to a list.

Does this help ?

(Label contents shown after button clicks)

The for each block will count through the numbers from start to end based upon the parameters you provide. You can then use the "number" in the "do" section

1 Like