1 00:00:01,000 --> 00:00:01,690 Hello. 2 00:00:01,870 --> 00:00:03,280 We'll come to this lecture. 3 00:00:03,370 --> 00:00:06,520 In this lecture, we're going to learn about the logical operators here. 4 00:00:06,700 --> 00:00:11,530 So these are the logical operators, which I will explain and you will learn in this lecture. 5 00:00:11,530 --> 00:00:17,620 So the logical, logical operators evaluate Boolean logic on bull types. 6 00:00:17,620 --> 00:00:21,970 So you characterize operators by how many operands they take. 7 00:00:21,970 --> 00:00:31,450 So a unit operator takes a single parent and the binary operator takes two a turner operator x three 8 00:00:31,450 --> 00:00:32,320 and so on. 9 00:00:32,320 --> 00:00:37,870 So you can categorize operators further by describing the types of their operations. 10 00:00:37,870 --> 00:00:49,030 So the unit negation operator here, this not operator takes a single operand and returns its opposite. 11 00:00:50,110 --> 00:00:52,440 In other words, you. 12 00:00:52,780 --> 00:00:56,080 Here, let me write texts here. 13 00:00:56,770 --> 00:00:58,990 If you write like. 14 00:01:01,230 --> 00:01:03,570 You a.re true. 15 00:01:04,690 --> 00:01:05,850 You are true. 16 00:01:05,910 --> 00:01:09,890 You will get the false here. 17 00:01:11,700 --> 00:01:12,060 Here. 18 00:01:12,060 --> 00:01:13,590 Let me actually. 19 00:01:18,970 --> 00:01:19,660 Okay. 20 00:01:23,070 --> 00:01:23,790 Not. 21 00:01:23,790 --> 00:01:24,940 Operator. 22 00:01:26,320 --> 00:01:26,920 Here. 23 00:01:27,900 --> 00:01:31,380 And to make it left all the way. 24 00:01:33,920 --> 00:01:43,310 So you will if you put the truth in this in the serpent, you will get the false or bitwise here. 25 00:01:43,310 --> 00:01:46,580 Or if you give the false, you will get true. 26 00:01:46,760 --> 00:01:52,490 So this takes only one operant and not operant takes only one operation. 27 00:01:52,490 --> 00:01:53,090 So. 28 00:01:53,090 --> 00:01:57,890 And the unit of negotiation, this is the neuron negotiation operator here. 29 00:01:58,070 --> 00:02:10,520 But the logical operators, for example, and ops and or operator here, this is or so this is and and 30 00:02:10,520 --> 00:02:11,300 this is all. 31 00:02:11,330 --> 00:02:20,440 So the logical end returns true only if both of its operations are true. 32 00:02:20,450 --> 00:02:23,000 So if for example. 33 00:02:25,700 --> 00:02:26,450 True. 34 00:02:27,980 --> 00:02:32,270 True and true, then this equals true. 35 00:02:32,840 --> 00:02:37,790 But if you give the serpent the true and false. 36 00:02:37,790 --> 00:02:38,720 True. 37 00:02:40,170 --> 00:02:41,940 And false. 38 00:02:42,150 --> 00:02:43,490 You will get the false. 39 00:02:43,500 --> 00:02:44,010 So. 40 00:02:44,100 --> 00:02:51,270 Actually, it might be complicated here, but I promise you will learn all about this appearance here. 41 00:02:51,450 --> 00:02:52,800 So at first. 42 00:02:54,050 --> 00:02:57,340 Will you still see this appearance? 43 00:02:57,350 --> 00:03:00,410 Complicated, but it's not that complicated at all. 44 00:03:00,650 --> 00:03:01,640 So. 45 00:03:03,130 --> 00:03:05,610 Let's make the ore operator here. 46 00:03:05,620 --> 00:03:07,390 So this is the ore operator. 47 00:03:08,470 --> 00:03:09,340 So if you. 48 00:03:11,530 --> 00:03:16,450 All logical or hear logical or if give the true. 49 00:03:17,240 --> 00:03:22,580 If either of the both of its operands are true, then it returns true, for example. 50 00:03:22,880 --> 00:03:34,520 So if, for example, I have false and true, this will give or let's make it more understandable if 51 00:03:34,520 --> 00:03:39,320 I have true and true or false and false, it doesn't matter here. 52 00:03:39,740 --> 00:03:42,950 It's appearance false. 53 00:03:43,430 --> 00:03:45,380 You will get through. 54 00:03:46,770 --> 00:03:47,190 Now. 55 00:03:50,160 --> 00:03:51,330 You will get false. 56 00:03:51,630 --> 00:03:55,590 But if you give true and. 57 00:03:56,800 --> 00:03:57,550 False. 58 00:03:57,670 --> 00:03:59,260 You will get false, too. 59 00:03:59,770 --> 00:04:00,580 You will get truth. 60 00:04:01,090 --> 00:04:02,080 Sorry for this. 61 00:04:02,200 --> 00:04:06,070 So if you have just one true, you will get the truth here. 62 00:04:06,070 --> 00:04:13,360 But if you have to false which is zero, you will get the false with this operator. 63 00:04:13,750 --> 00:04:20,350 So logical operators might seem confusing at first, but they quickly become intuitive. 64 00:04:20,470 --> 00:04:24,460 So let's open our Visual Studio code here. 65 00:04:26,400 --> 00:04:29,280 This is our Visual Studio code. 66 00:04:30,460 --> 00:04:31,030 Okay. 67 00:04:32,110 --> 00:04:34,030 So this is our Visual Studio code. 68 00:04:34,210 --> 00:04:36,790 Let's delete the previous lectures. 69 00:04:43,570 --> 00:04:44,140 Here. 70 00:04:45,020 --> 00:04:51,320 This is all the lectures which you can download these codes in the downloadable sections of this Udemy 71 00:04:51,320 --> 00:04:51,740 course. 72 00:04:51,770 --> 00:04:55,250 Oxley So let's create some. 73 00:04:56,350 --> 00:04:56,800 Here. 74 00:05:02,940 --> 00:05:09,330 Okay, So let's create, for example, bull of a bull. 75 00:05:09,360 --> 00:05:11,220 So this is the bull, as you know. 76 00:05:11,460 --> 00:05:14,850 In previous lectures, we learned about the bull type. 77 00:05:16,020 --> 00:05:19,890 For example, true equals true. 78 00:05:21,580 --> 00:05:27,460 Mu f v this dismiss false equals false here. 79 00:05:27,640 --> 00:05:32,430 And let's create our illustrations with our common line here. 80 00:05:32,440 --> 00:05:34,570 And so print f. 81 00:05:34,810 --> 00:05:35,740 Print f. 82 00:05:37,300 --> 00:05:38,170 Let's start. 83 00:05:38,650 --> 00:05:40,050 Let's start with. 84 00:05:44,490 --> 00:05:47,490 Let's start with the note operator here. 85 00:05:49,260 --> 00:05:49,980 Okay. 86 00:05:54,400 --> 00:05:56,560 So let's start with not. 87 00:05:56,590 --> 00:05:57,700 Operator. 88 00:05:58,300 --> 00:06:02,050 We will illustrate in code through. 89 00:06:03,500 --> 00:06:06,320 The and new line. 90 00:06:08,180 --> 00:06:13,420 Here new line and gave this the scale. 91 00:06:13,640 --> 00:06:18,260 Give us the thrill operator here. 92 00:06:19,040 --> 00:06:19,670 True. 93 00:06:20,750 --> 00:06:30,010 As you can see here, we gave the we use this ternary this note operator and we operate it this true. 94 00:06:30,560 --> 00:06:34,880 So after after this, you will see what it will give to us. 95 00:06:35,150 --> 00:06:37,160 And then print f. 96 00:06:38,120 --> 00:06:39,920 So let me mention here. 97 00:06:39,950 --> 00:06:44,810 The one is true and the zero is false. 98 00:06:47,920 --> 00:06:51,340 This is the pretty common information here. 99 00:06:51,340 --> 00:06:53,260 That one is true and zero is false. 100 00:06:53,260 --> 00:06:55,840 But some of you might not know about this. 101 00:06:56,110 --> 00:07:07,750 So in case I wrote this down here and let's continue on next line here, the true and. 102 00:07:09,300 --> 00:07:11,280 True, True and false. 103 00:07:13,200 --> 00:07:14,140 At the. 104 00:07:15,310 --> 00:07:16,450 A new line. 105 00:07:17,420 --> 00:07:18,470 Let's see. 106 00:07:20,530 --> 00:07:21,190 T. 107 00:07:22,760 --> 00:07:24,290 And pass. 108 00:07:25,310 --> 00:07:27,530 T and false. 109 00:07:28,510 --> 00:07:31,620 And let's continue with, as I always do. 110 00:07:31,630 --> 00:07:38,470 I will explain all of this course later when we extract the and run these quotes. 111 00:07:38,770 --> 00:07:40,210 So printf. 112 00:07:42,080 --> 00:07:42,830 True. 113 00:07:43,430 --> 00:07:45,830 And here we will. 114 00:07:48,070 --> 00:07:48,560 Print. 115 00:07:48,820 --> 00:07:49,540 True. 116 00:07:50,690 --> 00:07:56,810 Here we will see the true and. 117 00:07:57,550 --> 00:07:58,780 Not false. 118 00:08:00,160 --> 00:08:01,810 And let's create here. 119 00:08:02,810 --> 00:08:03,620 That's small. 120 00:08:04,670 --> 00:08:09,720 I which will give us the zero or run in case it's it says zero. 121 00:08:09,740 --> 00:08:12,230 It will give us the zero. 122 00:08:12,860 --> 00:08:14,120 It will give us the false. 123 00:08:14,120 --> 00:08:22,580 But in case it's the one, which is it to the compiler will show us the one here. 124 00:08:22,580 --> 00:08:23,180 So. 125 00:08:24,800 --> 00:08:27,530 Then let's give this the. 126 00:08:29,560 --> 00:08:30,340 True. 127 00:08:31,430 --> 00:08:32,180 And. 128 00:08:33,210 --> 00:08:34,890 True and not false. 129 00:08:35,370 --> 00:08:36,390 Not false. 130 00:08:37,700 --> 00:08:38,870 Not fear. 131 00:08:39,440 --> 00:08:42,030 And let's add another line of code here. 132 00:08:42,050 --> 00:08:43,040 Printf. 133 00:08:44,950 --> 00:08:47,500 True or true? 134 00:08:47,690 --> 00:08:49,030 True or false? 135 00:08:51,370 --> 00:08:52,810 True or false? 136 00:08:55,700 --> 00:08:56,450 Here. 137 00:08:57,920 --> 00:08:58,550 Oops. 138 00:09:00,860 --> 00:09:01,520 Here. 139 00:09:02,000 --> 00:09:04,040 Actually, it's okay. 140 00:09:07,460 --> 00:09:11,780 True or false and give this true. 141 00:09:12,810 --> 00:09:14,190 Interpreters here. 142 00:09:14,220 --> 00:09:15,030 Paul's. 143 00:09:16,520 --> 00:09:17,420 F r. 144 00:09:18,150 --> 00:09:26,670 So, as you know, here we have a boolean variable which named T is true and boolean variable named 145 00:09:27,090 --> 00:09:31,740 F is false here and print F. 146 00:09:32,490 --> 00:09:32,770 Last. 147 00:09:32,820 --> 00:09:38,430 This is the last line of code which after this you will know about. 148 00:09:38,430 --> 00:09:45,210 And I will explain all of this course code lines later line by line and false. 149 00:09:46,530 --> 00:09:48,120 Or operator False. 150 00:09:52,220 --> 00:09:57,980 Balls here and there and new line here. 151 00:09:57,980 --> 00:09:59,510 We will get the f. 152 00:10:00,080 --> 00:10:00,490 F. 153 00:10:00,920 --> 00:10:01,310 Yeah. 154 00:10:02,550 --> 00:10:13,380 Lastly, and then let's save our code and run our program seemed where was our program? 155 00:10:13,380 --> 00:10:13,660 Here. 156 00:10:13,680 --> 00:10:15,390 Let me find it. 157 00:10:16,970 --> 00:10:18,290 Okay, dear. 158 00:10:19,760 --> 00:10:22,660 See that desktop there? 159 00:10:22,700 --> 00:10:24,180 Here it is. 160 00:10:24,200 --> 00:10:25,640 Keep the. 161 00:10:27,060 --> 00:10:29,710 Okay, so let's compile our application here. 162 00:10:29,730 --> 00:10:36,150 GCSE followed by so GCSE or clear. 163 00:10:36,150 --> 00:10:39,120 Firstly GCSE. 164 00:10:39,150 --> 00:10:39,780 Main. 165 00:10:39,780 --> 00:10:43,140 That main dot CP here. 166 00:10:43,170 --> 00:10:50,430 Our code is compiled without an error and then let's run this programme. 167 00:10:51,460 --> 00:10:53,110 Pay that exam here. 168 00:10:53,110 --> 00:10:58,160 So as you can see here, we have these codes. 169 00:10:58,180 --> 00:11:01,510 So let's copy this code here. 170 00:11:01,840 --> 00:11:02,290 Oops. 171 00:11:06,690 --> 00:11:07,290 Here. 172 00:11:13,440 --> 00:11:22,950 And copy and paste this course in our diagram to explain it more here. 173 00:11:24,720 --> 00:11:25,140 Oops. 174 00:11:25,630 --> 00:11:25,850 What? 175 00:11:27,130 --> 00:11:27,600 Okay. 176 00:11:30,060 --> 00:11:31,950 Actually, we can do this in. 177 00:11:33,000 --> 00:11:33,510 Right. 178 00:11:35,390 --> 00:11:36,050 So. 179 00:11:38,370 --> 00:11:42,240 Let's explain this cause one by one. 180 00:11:43,340 --> 00:11:50,510 Here at the first you see the negotiation operator. 181 00:11:51,410 --> 00:11:52,520 Which is false. 182 00:11:53,230 --> 00:11:57,980 So if true is not true, then it's false. 183 00:11:58,000 --> 00:12:01,690 So it gave us the zero, which is false. 184 00:12:01,840 --> 00:12:04,030 And the second here. 185 00:12:04,630 --> 00:12:05,270 Second. 186 00:12:06,770 --> 00:12:07,430 True. 187 00:12:07,460 --> 00:12:09,110 Not true, Operator. 188 00:12:11,430 --> 00:12:12,090 Here. 189 00:12:13,510 --> 00:12:14,110 Or not. 190 00:12:14,260 --> 00:12:14,620 True. 191 00:12:14,620 --> 00:12:16,000 True and and false. 192 00:12:16,000 --> 00:12:21,340 Here, if true and then false. 193 00:12:22,520 --> 00:12:31,940 As I said, if you use true in order in order to you if you have to get through from this and operator, 194 00:12:32,240 --> 00:12:40,310 you need to give the twice to true operators in this operator. 195 00:12:40,340 --> 00:12:53,550 So as you shown here, we get we got the zero from this operation and then true and not false. 196 00:12:53,570 --> 00:13:02,750 So if it's not fast, we will get the true, true or false, we will get one, as I explained in this 197 00:13:02,750 --> 00:13:04,290 lecture at the beginning. 198 00:13:04,310 --> 00:13:09,580 And if false or false, it will give us a zero. 199 00:13:09,590 --> 00:13:23,270 Because in order to work with get one from our operator, we need at least one true in our operation. 200 00:13:25,370 --> 00:13:33,320 So I'm waiting for the next lecture, which in the next lecture we will learn the new type year standard 201 00:13:33,320 --> 00:13:34,250 by type. 202 00:13:34,250 --> 00:13:36,710 So I'm waiting you in the next lecture.