Hello and welcome to the and programming language course in the preview session, we talked about competition
operators and indecision.
We want to talk about the other operators concept.
Logical operators, logical operators are used to determine the logic between variables or values.
They are used to combine two or more conditions or constraints or to complement the evaluation of the
original condition in consideration.
Logical operators and go length are logical and logical, old and logical nuts.
Now let's go to this quote.
Bring it on to illustrate how to use logical operators.
First, define three variables and initialize them, for example, via X Common Y Z and initialize by
the values 100, 200 and 300.
In the first case, we want to check logical and operator.
So the right FP
x less than y logical and x unitard then z because we use phenomenological and operator returns.
True value if both statements are true, means x less than Y is true and x greater downs.
It is true and we know that if the answer of any statement is false, final result will be false.
Now save the project and go to turn on and execute the program.
So, Ron, the and go right back, is this mean that good?
Now we can see the output.
The result is false.
In the first section, we want to check your weather is the variable.
It's less than the variable y or not, which means weather is a hundred less than 200 and the result
is true.
And in the next session, we want to check whether is the variable is greater than the variable that
or not, which means weather is 100 greater than 300 or not.
And the result is false.
So the logical and operator between true and false returns false value.
In the second case, we want to check logical or operator.
So first clear, last cold.
So tried FP.
X less than y logical or even greater than that, because we from logical all operate all return through
value, if both statements are true and we know that if the answer of any statement is true, final
result will be true.
So save the project and execute the program.
So be right.
Go wrong.
Beck is left me that go in the first section.
We want to check whether is the variable that less than the variable y or not, which means Vector is
100 less than 200 and the result is true.
And in the next session, we want to check whether is the variable is greater than the variable Z or
not, which means Vector is 100 greater than 300 or not, and the result is false.
So the logical or operator between true and false return, true value term case.
In this case, if you want to check logical not so first year the last quote.
Right.
Iffy, logical, not open and close Francis's.
Is equal to y logical and.
It's greater than that.
OK.
Because we use from logic and not operate or reverse the result returns false if the result is true
or returns true if the result is false.
So we they could save the project and execute the program.
Now we can see the output result is true in the first section.
We want to check whether is the variable X equal to Y or not, which means whether is 100 equals 200
and the result is false.
And in the next section, we want to check whether is the variable is greater than the variable is it
or not, which means whether is 100 greater than 300 or not.
And the result is false.
So the logical and operator between false and false return, false value and logical not to play true
false value is true.
So the final result is true.
Okay, we were able to explain the definition of logical operators and give examples in order not to
prolong the time of decision.
We will finish it and we will continue the content in the next session.
Goodbye.