Hey, guys, what's up?
So today we are going to see those operator.
Tertiary operator.
OK.
So what it does.
For example, if I were writing a phase of the DNC to see out positive.
No see out positive.
And it's.
See out.
Negative number.
Now, with the help of a shady operator, I can also write it, so I will write something like.
If he is in it, does it or if this condition is to seek out.
Positive.
And if this condition is falls, then see out negative.
OK, so this is they use case of their shady operator.
So how it works?
So if this is my condition.
OK, so this is my condition.
So if the condition is true, this will be executed.
And if the condition is false, then this will be executed.
OK.
So if the condition is false, this will be executed.
So this is how it works.
So let's say somewhat example.
For example.
Bulley.
Is even is even is a variable.
So is even.
It goes let's say X is a X is also a variable integer variable.
So if X more do it cause it equals zero.
So this is my condition.
So if this condition is true.
I will return to.
And if this condition is false, I will return false.
OK, so you can also use this totally operator on the right hand side.
Now what volume output?
Let's say X equals six.
And you are printing C out is even.
So four X equals six.
So this condition is true.
So my output will be so easy when it's containing through some output will be when.
OK, so let's ride called to get a better understanding.
So let's name it.
That is Sheree.
OK, so let us solve the problem with the help of a shady operator.
The problem is very simple.
I will be given a number.
OK, so I will take a number as input.
And I have to print and I have to tell the user whether that number is even or whether the number is.
So we have already started it with the help of a friend and now we will solve it with the help of by
Shady Operator.
OK, so let's do.
So first of all, I am taking a variable and and so I see out.
And there are no.
Seeing and.
Now, if so, it does show you we using by serial murder, so.
And more to it consequence zero.
So this is my condition.
So if this condition is true, what I have to do, that means my number is even so sealed even.
And if this condition is false, then this number is an art number.
Associate ARED.
And that is all.
OK.
So let's head Annette.
So and there are no let's say number is five.
So my number is ARED.
And let's say my number is.
For so I number is even.
So how it is working?
So, for example, if number is five, so I will check this condition.
So five more.
Two is not close to zero.
So this condition is false.
So I will come here.
Condition is false and I will print see out.
Now, if this condition.
Now, let's see.
And it was six.
So.
Six more, two equals zero.
So this condition is true since this condition is true.
I will come here.
OK.
I will Brint even.
OK.
So if this condition is through, this is made through Bart.
OK, so this is true and this is false.
OK.
So in short condition.
Question mark.
If this condition is true, what do you to do then call them and then false?
OK, so this is how I you operator.
Works condition, then, if the condition is true and what do you want to do and if the condition is
false, then what do you want to do?
OK.
So this is it for the shady operator.
OK.
Thank you.