 Hey everybody this is Brian and this is our 14th video. Today we're going to be discussing the for loop. Now the basic structure of a for loop is this. That is how you make an infinite loop. Let's say C out. Let's just say whoops say hello. That is an infinite for loop meaning nothing is ever going to change. It's just going to keep spinning out hello hello hello. It's like the annoying person at work that says hello 5,000 times. Okay now let's break this out a little bit. 4 and then we got these two semicolons in there. What's going on with that? Well this is where we say int i equals zero so that's where we initialize it and this middle section is where we determine how long to do this for. It's the while part so we'll say i is less than 100 and this is the action we want to perform so we'll say i increment. So let's just print out the value here and sure enough it goes up to 100 and stops. So let's break this down a little bit more. Here's the for statement. Here is the code block it's going to execute. The first section let's actually put some spaces in here to make these sections a little clearer. The first section this is our declaration. This is where we create the variable and set the initial value and the second section this is the while portion. While this is true so this is the expression being evaluated and this is the action we want to perform. For example we're going to increment. Now we could very easily flip this around and say for i equal 100 while i is greater than zero we're going to decrement i. So any guesses what this is going to do? Well if you thought it was going to count backwards from 100 to zero you answered correctly. That is the basic for statement and remember with these you can always just nestle some other things in here so we'll say if and then else and we'll say if i equals two then we're just going to say yay. Otherwise we're going to say boo and that gives you an idea of how you can really nestle things in there and that is the for loop. As you can see it counted from 100 down to zero when it hit two it printed yay otherwise it just printed boo. I realize i'm going through these tutorials rather quickly. I have to admit if c++ is your first programming language these are probably not the tutorials for you. I'm jumping through these tutorials rather quickly so that we can get on to more advanced topics. We're really going to be starting c++ cute programming very soon. So stay tuned. Thank you for watching.