1 00:00:03,180 --> 00:00:04,440 In this lecture. 2 00:00:05,640 --> 00:00:09,320 You will learn about the bullying types here. 3 00:00:11,730 --> 00:00:14,850 William types have two states. 4 00:00:15,630 --> 00:00:18,090 True or false? 5 00:00:20,160 --> 00:00:31,950 The sole boolean type is bool, so integer types and the bull types convert really the true state converts 6 00:00:31,950 --> 00:00:32,970 to one. 7 00:00:33,450 --> 00:00:35,760 So true equals to one. 8 00:00:36,150 --> 00:00:37,920 But the zero. 9 00:00:37,920 --> 00:00:40,830 So false equals to zero. 10 00:00:43,560 --> 00:00:47,940 So any non-zero integer converts to one. 11 00:00:49,400 --> 00:01:03,300 And the non zero one and the zero converts 020 or zero equals false. 12 00:01:03,590 --> 00:01:08,510 So in integer types here, integer to boolean. 13 00:01:08,960 --> 00:01:11,800 So we have a boolean literals here. 14 00:01:11,810 --> 00:01:19,700 So to to initialize boolean types you use to boolean literal either true or false. 15 00:01:19,700 --> 00:01:30,260 Here, my bool boolean equals you can assign this true or false. 16 00:01:31,910 --> 00:01:32,540 False. 17 00:01:33,440 --> 00:01:33,630 Yeah. 18 00:01:33,710 --> 00:01:40,130 So we have a format specifiers for bullying as well as other variables. 19 00:01:40,760 --> 00:01:47,780 The format specified for bullying is the there is no format specified for bullying actually, but you 20 00:01:47,780 --> 00:01:55,970 can use the integer format specified d within the printf to yield a one. 21 00:01:56,800 --> 00:02:00,170 Or true and zero or false. 22 00:02:00,190 --> 00:02:08,020 The reason is that the printf promotes an integral value smaller than an integer to an end. 23 00:02:08,200 --> 00:02:18,460 So here, let's create a code that illustrates how to declare a boolean variable and inspect its value. 24 00:02:19,770 --> 00:02:27,440 So so before it, I want to show you some illustrations here, which I got from the Internet, Google 25 00:02:27,450 --> 00:02:28,080 Pictures. 26 00:02:29,280 --> 00:02:39,420 So we have you will learn about the logical and then the or tables in later in this lectures actually. 27 00:02:39,600 --> 00:02:41,380 So you will learn about. 28 00:02:42,270 --> 00:02:43,880 Let me open the separator. 29 00:02:43,890 --> 00:02:47,170 So we we are now learning about the three operators. 30 00:02:47,190 --> 00:02:51,670 As you know, there is a six operators types in C++. 31 00:02:51,690 --> 00:03:05,190 Now we'll we are learning about the logical operators of C plus plus and which actually you already 32 00:03:05,190 --> 00:03:06,910 know arithmetic operators. 33 00:03:06,930 --> 00:03:16,650 Now we are learning about the logical operators after that same bitwise, relational operators and other 34 00:03:16,650 --> 00:03:17,600 operators. 35 00:03:17,610 --> 00:03:18,600 So. 36 00:03:19,950 --> 00:03:26,190 This is the arithmetic relational, logical bitwise, increment, increment and assignment operator. 37 00:03:26,210 --> 00:03:32,430 So now we are learning about logical operators with boolean numbers. 38 00:03:32,970 --> 00:03:33,780 So. 39 00:03:35,610 --> 00:03:36,510 Here. 40 00:03:36,540 --> 00:03:40,270 This is the logical operator smelts, which you will learn here. 41 00:03:40,290 --> 00:03:46,000 So let's create our code and I will explain all of this details later. 42 00:03:46,020 --> 00:03:49,050 So let's create an bool number. 43 00:03:49,170 --> 00:03:51,330 Bool p one True. 44 00:03:51,720 --> 00:03:59,760 I will explain all of these codes later, as I will, as I always do, will be two equals false. 45 00:04:01,300 --> 00:04:03,400 And the plaintiff. 46 00:04:04,380 --> 00:04:04,530 Yeah. 47 00:04:04,530 --> 00:04:05,850 Let's use our own format. 48 00:04:05,850 --> 00:04:06,960 Specifiers. 49 00:04:06,990 --> 00:04:13,500 The the a new line gave this as variable B one, B two. 50 00:04:13,500 --> 00:04:14,240 As you know. 51 00:04:14,250 --> 00:04:20,490 Now this B one goes to the first format specify and B two goes to. 52 00:04:21,920 --> 00:04:29,720 Second famous misfire, which you know already, but I want to wanted to mention it and let's compile 53 00:04:29,810 --> 00:04:31,040 it our quote. 54 00:04:32,810 --> 00:04:32,990 The. 55 00:04:36,220 --> 00:04:43,120 We c c mean that c p p here and e a that exit. 56 00:04:44,080 --> 00:04:54,880 The first variables which is the b one comes through because as I said, if there's a one, if the integer 57 00:04:54,880 --> 00:04:56,560 is one, then this true. 58 00:04:56,560 --> 00:04:59,200 If the boolean is true, then integer is one. 59 00:04:59,590 --> 00:05:05,830 So it shows us the one and B two is false because of that zero. 60 00:05:06,610 --> 00:05:10,750 It showed us zero and console. 61 00:05:12,220 --> 00:05:20,320 So in bull with bullion, it automatically comes to the comparison operators because that's what bullion 62 00:05:20,320 --> 00:05:21,460 is all about, right? 63 00:05:21,760 --> 00:05:31,360 The operators are functions that perform computations on operations, or parents are simply objects, 64 00:05:31,390 --> 00:05:35,370 logical operators you will see in later lectures. 65 00:05:35,380 --> 00:05:43,600 So in order to have a meaningful examples using pull types, you will take a quick look at comparison 66 00:05:43,600 --> 00:05:47,650 operators in this lecture and logical operators in the next. 67 00:05:47,650 --> 00:05:51,760 So you can use several operators to build Boolean expressions. 68 00:05:52,180 --> 00:05:57,620 Recall the comparisons comparison operators, take two arguments and return a bull. 69 00:05:57,640 --> 00:06:01,150 So the available operators are equal to here. 70 00:06:02,680 --> 00:06:05,650 Equality, inequality. 71 00:06:06,160 --> 00:06:16,210 So let me write that down here so I can share it with share with you in our lectures, downloadable 72 00:06:16,210 --> 00:06:20,930 sections, so you can download it and use it in your own compiler. 73 00:06:20,950 --> 00:06:22,780 So this is the equality. 74 00:06:25,520 --> 00:06:26,570 Equality. 75 00:06:27,740 --> 00:06:30,140 And this is in a quality. 76 00:06:37,510 --> 00:06:38,940 And then here. 77 00:06:39,100 --> 00:06:40,270 Here it comes. 78 00:06:40,270 --> 00:06:41,020 The. 79 00:06:42,940 --> 00:06:44,590 Here comes the Greta. 80 00:06:44,590 --> 00:06:45,100 Than. 81 00:06:46,700 --> 00:06:48,560 Then less than. 82 00:06:51,670 --> 00:07:00,490 Less than and greater than or equal to greater than or equal to. 83 00:07:03,630 --> 00:07:04,370 Three. 84 00:07:04,470 --> 00:07:10,500 It's like a math operators write you, which you learned in middle school, I think, or. 85 00:07:11,990 --> 00:07:24,050 Peter Pan and less than ops greater, not greater than here, greater than or equal. 86 00:07:25,310 --> 00:07:25,790 Two. 87 00:07:26,030 --> 00:07:28,430 And here is less than. 88 00:07:29,330 --> 00:07:30,560 Less than. 89 00:07:32,030 --> 00:07:33,830 Or equal to. 90 00:07:36,970 --> 00:07:37,420 Here. 91 00:07:37,690 --> 00:07:38,380 So. 92 00:07:40,330 --> 00:07:43,260 Let's create an example program about this. 93 00:07:45,930 --> 00:07:46,860 We cheer. 94 00:07:48,930 --> 00:07:50,940 Let's print something here. 95 00:07:52,560 --> 00:07:53,580 Seven. 96 00:07:54,030 --> 00:07:54,680 Equal. 97 00:07:54,720 --> 00:07:57,930 Equal sign and seven. 98 00:07:58,890 --> 00:08:00,000 Here, DD. 99 00:08:00,030 --> 00:08:00,780 I will explain. 100 00:08:00,780 --> 00:08:02,190 All of this called later. 101 00:08:04,600 --> 00:08:06,590 Seven equally close ups. 102 00:08:06,610 --> 00:08:08,080 Not like that 103 00:08:10,930 --> 00:08:11,830 new line. 104 00:08:14,780 --> 00:08:16,720 Seven equals seven. 105 00:08:17,330 --> 00:08:17,630 Yes. 106 00:08:19,140 --> 00:08:25,380 It will show us the numbers about that This is that true or false? 107 00:08:27,150 --> 00:08:36,540 Which I will explain later, as I always do when writing some quotes in a crowded sign. 108 00:08:39,480 --> 00:08:46,560 So I don't want to just bring my lecture time. 109 00:08:46,920 --> 00:08:50,280 So I will pause this lecture here. 110 00:08:50,460 --> 00:08:58,860 So after that, like, I have to write like five or six lines of code or whatever. 111 00:08:58,890 --> 00:09:01,530 This is just this will be quick enough. 112 00:09:02,730 --> 00:09:06,120 So I promise it's quick enough. 113 00:09:06,690 --> 00:09:09,030 So you watch here and learn. 114 00:09:09,570 --> 00:09:12,600 This is the unique Unicode sign. 115 00:09:13,890 --> 00:09:18,480 Not equal to seven Plaintiff. 116 00:09:20,060 --> 00:09:20,990 Trend test. 117 00:09:21,710 --> 00:09:25,550 Year ten Greater than 12. 118 00:09:29,210 --> 00:09:33,620 In 20 year and less call. 119 00:09:34,910 --> 00:09:41,210 And greater than 20% have. 120 00:09:44,870 --> 00:09:45,650 Ten. 121 00:09:45,680 --> 00:09:49,070 Greater than or equal to 20. 122 00:09:51,260 --> 00:09:56,410 He knew at first the form specified for integer and boolean. 123 00:09:58,740 --> 00:10:00,480 A here and. 124 00:10:01,970 --> 00:10:02,660 Ten. 125 00:10:03,290 --> 00:10:05,630 Greater than or equal to 20. 126 00:10:07,360 --> 00:10:09,040 Hear and print. 127 00:10:11,540 --> 00:10:13,100 And less than 20. 128 00:10:15,490 --> 00:10:18,430 Woman Specifiers always and new line. 129 00:10:19,670 --> 00:10:21,740 Ten less than 20. 130 00:10:25,230 --> 00:10:25,950 Okay. 131 00:10:26,160 --> 00:10:29,540 And last line print f. 132 00:10:33,280 --> 00:10:34,130 20. 133 00:10:34,360 --> 00:10:36,490 Less than or equal to. 134 00:10:37,950 --> 00:10:38,580 20. 135 00:10:40,690 --> 00:10:46,240 Clement specified new line and our competitors are all real comparison. 136 00:10:46,240 --> 00:10:50,920 So these are the just texts so you can you can don't right. 137 00:10:51,580 --> 00:10:55,120 You can also write this text on this predictive function. 138 00:10:55,240 --> 00:10:57,910 But I wanted to write because of that. 139 00:10:57,910 --> 00:11:05,050 I want to show you how these comparison operators works with illustration here. 140 00:11:08,190 --> 00:11:08,810 20. 141 00:11:08,880 --> 00:11:10,950 Less than or equal to 20. 142 00:11:13,100 --> 00:11:13,640 Yeah. 143 00:11:15,550 --> 00:11:18,370 So let's compile our code now. 144 00:11:19,060 --> 00:11:19,690 Clear. 145 00:11:22,160 --> 00:11:23,600 Jesse Mendes c. 146 00:11:23,600 --> 00:11:23,830 P. 147 00:11:23,840 --> 00:11:24,530 P. 148 00:11:24,560 --> 00:11:24,770 E. 149 00:11:24,980 --> 00:11:25,220 X. 150 00:11:26,450 --> 00:11:28,070 Here, as you can see here. 151 00:11:28,690 --> 00:11:29,440 So. 152 00:11:31,330 --> 00:11:32,830 Each comparison year. 153 00:11:33,130 --> 00:11:38,890 Each comparison year produced a Boolean result here. 154 00:11:41,020 --> 00:11:41,920 So. 155 00:11:41,920 --> 00:11:48,310 And the print statement prints the boolean as integer one or zero. 156 00:11:49,320 --> 00:11:53,040 So let's look at this quote and our output here. 157 00:11:53,130 --> 00:11:56,310 So seven is seven equals zero seven. 158 00:11:56,730 --> 00:11:57,330 Yes. 159 00:11:57,330 --> 00:11:58,920 And this is a true. 160 00:11:58,920 --> 00:12:04,260 And the compiler gave us one is seven is not equal to seven. 161 00:12:04,960 --> 00:12:07,480 No, because seven is not. 162 00:12:07,600 --> 00:12:11,430 Seven is equal to seven and this is false. 163 00:12:11,440 --> 00:12:14,500 So this gave us compiler gave us zero. 164 00:12:14,950 --> 00:12:16,510 Is ten greater than. 165 00:12:17,840 --> 00:12:18,530 20. 166 00:12:19,610 --> 00:12:24,290 No, because 20 is greater than ten and the scale was zero. 167 00:12:24,560 --> 00:12:28,040 Is ten greater than or equal to 20? 168 00:12:28,910 --> 00:12:30,170 Again, no. 169 00:12:30,650 --> 00:12:32,530 This gave us the zero. 170 00:12:32,540 --> 00:12:38,330 So false is ten less than 20? 171 00:12:40,290 --> 00:12:41,190 Yes. 172 00:12:41,190 --> 00:12:42,180 So true. 173 00:12:42,210 --> 00:12:45,210 This gave us the one here, as you can see here. 174 00:12:46,750 --> 00:12:50,330 So is 20. 175 00:12:50,350 --> 00:12:54,070 Less than or equal to 20. 176 00:12:55,950 --> 00:12:58,470 So the answer is yes. 177 00:12:58,590 --> 00:13:02,730 So true, because 20 is not less than. 178 00:13:02,730 --> 00:13:08,580 But here we have the second operator equality sign. 179 00:13:08,580 --> 00:13:11,280 So 28 is equal to 20. 180 00:13:16,980 --> 00:13:20,790 In the next lecture, you will learn about the logical operators. 181 00:13:22,240 --> 00:13:24,400 So I'm writing you in the next lecture.