In this lecture.
You will learn about the bullying types here.
William types have two states.
True or false?
The sole boolean type is bool, so integer types and the bull types convert really the true state converts
to one.
So true equals to one.
But the zero.
So false equals to zero.
So any non-zero integer converts to one.
And the non zero one and the zero converts 020 or zero equals false.
So in integer types here, integer to boolean.
So we have a boolean literals here.
So to to initialize boolean types you use to boolean literal either true or false.
Here, my bool boolean equals you can assign this true or false.
False.
Yeah.
So we have a format specifiers for bullying as well as other variables.
The format specified for bullying is the there is no format specified for bullying actually, but you
can use the integer format specified d within the printf to yield a one.
Or true and zero or false.
The reason is that the printf promotes an integral value smaller than an integer to an end.
So here, let's create a code that illustrates how to declare a boolean variable and inspect its value.
So so before it, I want to show you some illustrations here, which I got from the Internet, Google
Pictures.
So we have you will learn about the logical and then the or tables in later in this lectures actually.
So you will learn about.
Let me open the separator.
So we we are now learning about the three operators.
As you know, there is a six operators types in C++.
Now we'll we are learning about the logical operators of C plus plus and which actually you already
know arithmetic operators.
Now we are learning about the logical operators after that same bitwise, relational operators and other
operators.
So.
This is the arithmetic relational, logical bitwise, increment, increment and assignment operator.
So now we are learning about logical operators with boolean numbers.
So.
Here.
This is the logical operator smelts, which you will learn here.
So let's create our code and I will explain all of this details later.
So let's create an bool number.
Bool p one True.
I will explain all of these codes later, as I will, as I always do, will be two equals false.
And the plaintiff.
Yeah.
Let's use our own format.
Specifiers.
The the a new line gave this as variable B one, B two.
As you know.
Now this B one goes to the first format specify and B two goes to.
Second famous misfire, which you know already, but I want to wanted to mention it and let's compile
it our quote.
The.
We c c mean that c p p here and e a that exit.
The first variables which is the b one comes through because as I said, if there's a one, if the integer
is one, then this true.
If the boolean is true, then integer is one.
So it shows us the one and B two is false because of that zero.
It showed us zero and console.
So in bull with bullion, it automatically comes to the comparison operators because that's what bullion
is all about, right?
The operators are functions that perform computations on operations, or parents are simply objects,
logical operators you will see in later lectures.
So in order to have a meaningful examples using pull types, you will take a quick look at comparison
operators in this lecture and logical operators in the next.
So you can use several operators to build Boolean expressions.
Recall the comparisons comparison operators, take two arguments and return a bull.
So the available operators are equal to here.
Equality, inequality.
So let me write that down here so I can share it with share with you in our lectures, downloadable
sections, so you can download it and use it in your own compiler.
So this is the equality.
Equality.
And this is in a quality.
And then here.
Here it comes.
The.
Here comes the Greta.
Than.
Then less than.
Less than and greater than or equal to greater than or equal to.
Three.
It's like a math operators write you, which you learned in middle school, I think, or.
Peter Pan and less than ops greater, not greater than here, greater than or equal.
Two.
And here is less than.
Less than.
Or equal to.
Here.
So.
Let's create an example program about this.
We cheer.
Let's print something here.
Seven.
Equal.
Equal sign and seven.
Here, DD.
I will explain.
All of this called later.
Seven equally close ups.
Not like that
new line.
Seven equals seven.
Yes.
It will show us the numbers about that This is that true or false?
Which I will explain later, as I always do when writing some quotes in a crowded sign.
So I don't want to just bring my lecture time.
So I will pause this lecture here.
So after that, like, I have to write like five or six lines of code or whatever.
This is just this will be quick enough.
So I promise it's quick enough.
So you watch here and learn.
This is the unique Unicode sign.
Not equal to seven Plaintiff.
Trend test.
Year ten Greater than 12.
In 20 year and less call.
And greater than 20% have.
Ten.
Greater than or equal to 20.
He knew at first the form specified for integer and boolean.
A here and.
Ten.
Greater than or equal to 20.
Hear and print.
And less than 20.
Woman Specifiers always and new line.
Ten less than 20.
Okay.
And last line print f.
20.
Less than or equal to.
20.
Clement specified new line and our competitors are all real comparison.
So these are the just texts so you can you can don't right.
You can also write this text on this predictive function.
But I wanted to write because of that.
I want to show you how these comparison operators works with illustration here.
20.
Less than or equal to 20.
Yeah.
So let's compile our code now.
Clear.
Jesse Mendes c.
P.
E.
X.
Here, as you can see here.
So.
Each comparison year.
Each comparison year produced a Boolean result here.
So.
And the print statement prints the boolean as integer one or zero.
So let's look at this quote and our output here.
So seven is seven equals zero seven.
Yes.
And this is a true.
And the compiler gave us one is seven is not equal to seven.
No, because seven is not.
Seven is equal to seven and this is false.
So this gave us compiler gave us zero.
Is ten greater than.
20.
No, because 20 is greater than ten and the scale was zero.
Is ten greater than or equal to 20?
Again, no.
This gave us the zero.
So false is ten less than 20?
Yes.
So true.
This gave us the one here, as you can see here.
So is 20.
Less than or equal to 20.
So the answer is yes.
So true, because 20 is not less than.
But here we have the second operator equality sign.
So 28 is equal to 20.
In the next lecture, you will learn about the logical operators.
So I'm writing you in the next lecture.