Hello world! I'm talking about loops in C# I have a program with a list box called lstNumbers. And I would like to add the numbers 1, 2, 3 to that list box. And I have the code here. That would do that. This is okay for 1, 2, 3, But if I wanted numbers up to 10, or even a hundred, this would be a tedious way to do it. I would like to use a loop. A loop is a control structure that repeats the same set of statements over and over again. The same exact statements. These statements are NOT identical because they have the constant in there that's being added. So, the first thing I'm going to do is add A declaration of a variable num. [int num=0;] And then instead of Add one. I'm going to say add num. That would add a 0. Right now, the way the code is, so I'm going to Increment num. and have the statement num plus plus. [num++] The way it is right now, num is 0. Here it becomes 1. And then we would add it to the list box. And if I repeat These two statements, It would add 2, And then a 3. And let's just run that to make sure that's what it does. And sure enough, there's my list box with the numbers 1, 2, 3. Since I have The same statement repeated three times. I could use a loop to do this. So inside the loop I'd like to have these two statements. So I'm going to say while... And then in parentheses we put when do you want this loop. to end [keep going] And, Let's say num is less than 3. And then the statements inside the loop would be inside curly braces: { } And we don't need the rest of these statements. This loop puts in the numbers 1, 2, 3. Let's trace through this and see how the loop works. So num has a value of 0. That's less than three. So we're going to execute all the statements inside the body of the loop. And num++ makes that one. And 1 is added to the list box. 1 is less than 3. We do num plus plus [num++], number becomes 2. And 2 is added to the list box. 2 is less than 3. So we're going to execute the body of the loop. num becomes 3. Three is added to the list box. And num is 3. 3 is not less than 3. The loop ends and we go to whatever statement we might have at the end of the loop. Let's just run it to make sure this works and sure enough there it is with. 1, 2, 3. inside the loop That's the structure of the while loop: you have the word while Inside the parentheses you have the condition under which it keeps going. If this is true we execute all the statements inside the body of the loop. Even if this [condition] becomes false at this point, we still do that. And then when this becomes false We end up down here, The next statement after the end of the Loop. And that's it for now.