Hello.
We'll come to this lecture.
In this lecture, we're going to learn about the logical operators here.
So these are the logical operators, which I will explain and you will learn in this lecture.
So the logical, logical operators evaluate Boolean logic on bull types.
So you characterize operators by how many operands they take.
So a unit operator takes a single parent and the binary operator takes two a turner operator x three
and so on.
So you can categorize operators further by describing the types of their operations.
So the unit negation operator here, this not operator takes a single operand and returns its opposite.
In other words, you.
Here, let me write texts here.
If you write like.
You a.re true.
You are true.
You will get the false here.
Here.
Let me actually.
Okay.
Not.
Operator.
Here.
And to make it left all the way.
So you will if you put the truth in this in the serpent, you will get the false or bitwise here.
Or if you give the false, you will get true.
So this takes only one operant and not operant takes only one operation.
So.
And the unit of negotiation, this is the neuron negotiation operator here.
But the logical operators, for example, and ops and or operator here, this is or so this is and and
this is all.
So the logical end returns true only if both of its operations are true.
So if for example.
True.
True and true, then this equals true.
But if you give the serpent the true and false.
True.
And false.
You will get the false.
So.
Actually, it might be complicated here, but I promise you will learn all about this appearance here.
So at first.
Will you still see this appearance?
Complicated, but it's not that complicated at all.
So.
Let's make the ore operator here.
So this is the ore operator.
So if you.
All logical or hear logical or if give the true.
If either of the both of its operands are true, then it returns true, for example.
So if, for example, I have false and true, this will give or let's make it more understandable if
I have true and true or false and false, it doesn't matter here.
It's appearance false.
You will get through.
Now.
You will get false.
But if you give true and.
False.
You will get false, too.
You will get truth.
Sorry for this.
So if you have just one true, you will get the truth here.
But if you have to false which is zero, you will get the false with this operator.
So logical operators might seem confusing at first, but they quickly become intuitive.
So let's open our Visual Studio code here.
This is our Visual Studio code.
Okay.
So this is our Visual Studio code.
Let's delete the previous lectures.
Here.
This is all the lectures which you can download these codes in the downloadable sections of this Udemy
course.
Oxley So let's create some.
Here.
Okay, So let's create, for example, bull of a bull.
So this is the bull, as you know.
In previous lectures, we learned about the bull type.
For example, true equals true.
Mu f v this dismiss false equals false here.
And let's create our illustrations with our common line here.
And so print f.
Print f.
Let's start.
Let's start with.
Let's start with the note operator here.
Okay.
So let's start with not.
Operator.
We will illustrate in code through.
The and new line.
Here new line and gave this the scale.
Give us the thrill operator here.
True.
As you can see here, we gave the we use this ternary this note operator and we operate it this true.
So after after this, you will see what it will give to us.
And then print f.
So let me mention here.
The one is true and the zero is false.
This is the pretty common information here.
That one is true and zero is false.
But some of you might not know about this.
So in case I wrote this down here and let's continue on next line here, the true and.
True, True and false.
At the.
A new line.
Let's see.
T.
And pass.
T and false.
And let's continue with, as I always do.
I will explain all of this course later when we extract the and run these quotes.
So printf.
True.
And here we will.
Print.
True.
Here we will see the true and.
Not false.
And let's create here.
That's small.
I which will give us the zero or run in case it's it says zero.
It will give us the zero.
It will give us the false.
But in case it's the one, which is it to the compiler will show us the one here.
So.
Then let's give this the.
True.
And.
True and not false.
Not false.
Not fear.
And let's add another line of code here.
Printf.
True or true?
True or false?
Here.
Oops.
Here.
Actually, it's okay.
True or false and give this true.
Interpreters here.
Paul's.
F r.
So, as you know, here we have a boolean variable which named T is true and boolean variable named
F is false here and print F.
Last.
This is the last line of code which after this you will know about.
And I will explain all of this course code lines later line by line and false.
Or operator False.
Balls here and there and new line here.
We will get the f.
F.
Yeah.
Lastly, and then let's save our code and run our program seemed where was our program?
Here.
Let me find it.
Okay, dear.
See that desktop there?
Here it is.
Keep the.
Okay, so let's compile our application here.
GCSE followed by so GCSE or clear.
Firstly GCSE.
Main.
That main dot CP here.
Our code is compiled without an error and then let's run this programme.
Pay that exam here.
So as you can see here, we have these codes.
So let's copy this code here.
Oops.
Here.
And copy and paste this course in our diagram to explain it more here.
Oops.
What?
Okay.
Actually, we can do this in.
Right.
So.
Let's explain this cause one by one.
Here at the first you see the negotiation operator.
Which is false.
So if true is not true, then it's false.
So it gave us the zero, which is false.
And the second here.
Second.
True.
Not true, Operator.
Here.
Or not.
True.
True and and false.
Here, if true and then false.
As I said, if you use true in order in order to you if you have to get through from this and operator,
you need to give the twice to true operators in this operator.
So as you shown here, we get we got the zero from this operation and then true and not false.
So if it's not fast, we will get the true, true or false, we will get one, as I explained in this
lecture at the beginning.
And if false or false, it will give us a zero.
Because in order to work with get one from our operator, we need at least one true in our operation.
So I'm waiting for the next lecture, which in the next lecture we will learn the new type year standard
by type.
So I'm waiting you in the next lecture.