 Hello guys, welcome back to another video. This is Crypt of Grounds here. Welcome out to another C sharp crash video This is episode 15 and today we're gonna be doing for loops if you're new here Make sure you subscribe to my channel turn on the occasion if you enjoy the video Make sure you leave a like and check out my other videos Which should be in the icon in the corner as it's going on with it. So for loops pretty self-explanatory Let's say these are good for making sums if you want to run through an array changing certain stuff You just basically want to run through a loop or certain amount of times, okay? So let's start with the initialation we have four which is our keyword here and we have our parentheses And we have a statement here or a declaration here We have a statement here and then we have our action here and then we got our code right here Okay, so let's say we want to start with int I equals zero. This is good for arrays, right? Okay, so I made my setup here kind of do a little over the top here I basically made it An interay with the size five which will look like this at the start before the for loop and this will be after the for loop Okay, all right. So now we're gonna start at zero right here And let's say we want I to be less than five Now what this means it will never go to five. It will always stop at four four will be the last time it runs however If you do I is greater than or equal to five It will try to go five and it will completely fail because five is out of bounds, right? So you can either do I is less than four. So keep going until As long as I is less than four Or no, no, no, sorry. I is less than five Or what you can do instead Is I Is less than or equal then Or is I is yeah, I or let So what I can also do is I is less than or equal than four. Okay? But however, it's this is good for reading it if you're new But it's honestly better to just do less than five Because you know our size is five, right? So I mean, I guess it's kind of easy to translate think about that way Okay, and then here let's say we want I to increment by one now You can obviously increment by two if you want to if you want to update every single Other array if you want to which we can do I can do that for example And let's say we want our temp in the array at index I because that's our variable right here Also, it's int I equal to zero my apologies And we're going to set this equal to I So after this is done basically it'll look like this at the end Just like this right Now let's say we want to skip Let's say we want to add it by two You can do plus equals two Okay, we don't need the semicolon right here. Don't do that. Okay So now if we do this It will start at zero it would go to two four and then stop Okay, so what it'll look like here instead is it'll look like this zero zero two zero four It's because we're skipping these ones because this is basically going to the even numbers in The for loop right Okay, so another thing to notice is that your IDE since you're using whole numbers here It'll say that you can put var. Yes, that's completely valid because these are integers Now you can do floats and you can just do float I equals zero and you can do um eyes less than One and let's say you want to commit every zero point one I mean, I don't know what you're going to do that for probably for sums or something like that But in our case We're using whole numbers so we can just make this bar Because it knows it's an integer, right? Anyways, that is it for this video. I hope you enjoyed makes you leave a like Subscribe to my channel if you're new and turn on notifications and check out my other videos Comments in my comment your suggestions below and your questions. Anyways, thanks for watching. Peace