 Hello guys crypto grounds here welcome back to another C sharp crash video this episode 14 today We're gonna be doing extra operators because I forgot some operators in the previous operators video So I'll cover those in here. Anyways, if you enjoyed this video, make sure you leave a like subscribe to my channel and turn on notifications And check out my other videos too. I also leave a comment below All right, let's get out with it So basically the ones I forgot and I talked about this in the last video is and or and the question mark operator Okay, those are pretty much the main ones that I forgot. So I'm gonna talk about this one So let's say we have an if statement Or we want to set let's not do an if statement. Let's just have a bull. So let's just say we for example, we have a public rule Now let's say we want to set example In our method obviously I don't have the public start void main, but Or you shouldn't know that by now You need to have that the public static void main. There you go. So we're gonna set example equal to let's say we have an int as well public int high Equal to six. So let's say we want to set this either the true or false. So what we can do is um Okay, so let's say we have high and high two and this is equal to seven and high two is equal to six So let's say we want to set this to true if these two are equal to each other if they're equal Um the specified condition so what we can do for and we can do if high or not high or not if sorry if high is equal to seven and High two is equal to six Then this will be true. Otherwise it'll be false So how does this work? so basically If both these are true Then it'll be true If one of them's false, it'll be false. So I'll kind of make a table for that. So let's say we have l and right l for left r for right so let's say l so this will be our output I guess And we'll put this as a result Hopefully it's not too confusing. So if left is true and right is true, then the results can be true If left is right or If left is false and right is false, then of course the results can be false. However, if one of them is false The result is false same vice versa Works that way just like that. So take a look at that real quick Let's say one of them isn't equal to that. Let's say high is equal to seven now Or equal to eight. So now this statement's false because this one's false. This one is true Okay And basically this and statement It checks for the first one first. So if this is false, it won't check for this one because it's automatically false, right Okay but however If this one's true Then it's going to check to see if this one's true as well If it's false, then it'll be marked as false. Okay, so let's do let's do or now Which is the double bar So now this will check for both of them if at least one of them is true Then this will be something true. So this is marked as false, but this one's marked as true So it can have to be both or at least one of them, right? Okay, so this is true because this one's true. I'm gonna make a little table for this too Okay, so we have our table down here. So let's say left is true And this one's true and the results can be true both are true and it's gonna be true So let's say the first one is true. The second one is not then it's gonna be true Same thing vice versa, but if they're both false, then our results can be false just like that Okay, hopefully that makes sense So now we can do here is the question mark operator Okay, so let's say We want Example to be an int as well instead of a bull Okay So we're gonna do we're gonna mess with only with I don't know what I was thinking, but I'll say I don't remember if I had two equals there If I did my apologies. I meant to have one, but okay. So let's say we have two ints Okay, so what we can do here. We can use all operators or two operators and one In the same thing here, right? So let's say we have let's check if high is equal to eight, okay And high two Is equal to six Right question mark. We can have our two are false if it's true example will be set to 10 If it's false then we could say it's a zero Something like this. This is really good for strings too. So it's like if high is so like for plural stuff So if high is equal to one then we could print out the plural Or the non plural the singular version of the The string and then you hear if it's plural they could do abs, right? So if we had coins in our string here Now let's say we want to add so it would be just coin, right? So what we can do here in our string again We're putting variables inside the string by using the curly braces and adding the dollar sign What we can do here is if high Is equal to one also in here we need to have parentheses. Okay Now in here we can put question mark And if it's equal to one then we're just going to leave it as empty Otherwise we will put an s in it because it's plural like that Okay, so that's kind of what the use is for and of course many other things making really short if else statements I keep knocking things over um Okay, I think that's all also, right Let's for example, let's set high two equal to four So now this is false because this may be true, but this is false which also makes it false Okay, which means example will be zero instead of 10 Anyways, if you enjoyed this video make sure you leave a like on this video comment below any suggestions or any questions Subscribe if you're new turn on notifications and check out my other videos. Anyways, thank you for watching. Peace