Welcome back.
In order to make the next thing a lot easier, we're going to look at if statements.
So in order to explain logical operators I believe it is best to explain if statements first.
So we're looking at an if statement by using the if keyword.
So we're basically saying if whatever is inside of the brackets is true then execute the code that comes
after it inside of those curly brackets.
So inside of here basically starting from this piece of code all the way to this position right here.
So everything that is in here will be executed if is rainy is true.
So I'm going to use a Console.WriteLine statement.
And I'm going to say it's rainy okay.
So let's run this code after by the way keeping our console awake.
So console dot read key and and now let's run our application and we will see it doesn't display anything.
Why does it not display anything.
Because as I said whatever is inside of here is deciding whether this piece of code is going to be executed
or not, basically meaning whether it's going to run or not.
This here has run.
So let's take this and put it down here and say a okay.
All right.
Let's run this again and see if A okay is going to be there.
So you see a okay is there.
But this it's rainy has not been executed.
So this piece of code didn't run.
And that's because this is rainy is false.
So here at the top we said it's not rainy.
So let's say suddenly it does start to rain.
Then we can run this again.
And we see it says it's rainy a okay.
So whether it's rainy or not, we're okay.
We're having a good time.
So that's great.
And this basically shows you what booleans are super valuable for.
They are valuable to decide whether something needs to be executed or something doesn't have to be executed.
And that's it for this video.
In the next one, we're then going to use the logical operators to play around with this if statement.
So see you there.