 Hello guys, Cryptograms here. Welcome back to another C-sharp, harsh, gross video. This is episode 13 and today we're doing if statements. And then we've talked about this before in the past, but this is going to be a review just so there's like a complete episode. In case you didn't watch any of the previous videos this is just completely dedicated to if statements. Anyways, if you enjoyed this video make sure you leave a like, subscribe if you're new, and turn on notifications for future videos. Anyway, so let's get on with it. Okay, so first we have a public ends high, which we're going to set at six, okay? Now, there's three types of conditions we can do with if statements. We have if else if And we got else. So basically what I talked about in one of my previous videos What I've talked about in the past is that once it checks this right here If it's true, it's not going to check any of these two, okay? So basically we're just going to do if high is equal to seven is equal to seven make sure If you haven't seen my operators video make sure you check it out because you learn what this means But this way I'm just going to explain it now But you should learn what all the operators are But basically this just checks if high is equal to seven Now you can't just do one equal sign because that sets high to seven this checking if it's equal So since we only want one line, we don't need to have curly braces, right? Console dot right and this will just print out seven, but since it's false It's not going to do any of that. Okay. So now we can also have an else statement where otherwise if it's not seven This is honestly the same thing as else if high Is not equal to seven we could do console dot right line I don't know for example low. I don't know just something like that Just for example, but in your id it's probably going to tell you this is redundant because This is the exact same thing as having an else However, if you want to check for something else If you just want to check for if it's six You can do else if high is equal to six and since it's six It will print this as long if you don't change it If you set high equal to seven beforehand Then it's going to run this right here and it's going to ignore all of this right here Okay, so now i'm going to talk about formatting real quick I've talked about this in the operators video But if you don't want to watch that since you know all the Operators, I'm just going to teach you how to format this. So I was only using that Because it was a one liner. Let's say we have two lines Then we have to add our curly braces so we can have our console so we can have our console dot right line High and we can also add a high or incremented by one like this Okay, so the curly braces are needed only if it's longer than two lines Or if you have a separate if else statement in here Because if you didn't have this if you had an else statement right here Let's say we had else and we're going to do high minus minus one for example Okay, so in the L statement where we do high minus minus or which just subtracts one From high as an example if we didn't if we had another If you had another if statement in here without the curly braces This your code will think that this else statement belongs to this if statement So that's why you're gonna have to add these curly braces in here Otherwise you can just do if high equals to Seven And also another thing I've got to talk about in the operators video. Grab it's the the and and or So we have and that's very bad. So you obviously know what the and looks like it looks like that, right? And let's say we have a separate bull I don't know. Let's just make that if that's true. Then we can just do high plus equals 10. I don't know just for example, okay This is the correct formatting Okay, so I should probably comment that in the video I forgot and and or but if you just in case I forget to do that This is and and the two bars Is or so you can either do and I guess this is kind of the appropriate place to put these but you can also do that too Okay, another thing I want to mention in here since I forgot to do that is the question mark operator So what we can do here? I'm probably gonna have to do a separate video on uh other operators, but Let's say we said high is equal to um Let's do if high is equal to six I can put a question mark now in here what the question mark is that we have the condition question mark And the output is true or false. Okay, so let's say if it's true 60 and it's false then we're gonna set it to zero. Okay, so since it's six, it's gonna set it to 60 However, if this is seven Then it's gonna set it to zero because it's false. Anyways, if you enjoyed this video Make sure you leave a like subscribe my channel and turn on notifications if you're new Check out my other videos in the top corner right there. Anyways, thank you for watching. Peace