1 00:00:13,950 --> 00:00:20,950 Hello and welcome to the and programming language course in the preview session, we talked about competition 2 00:00:21,000 --> 00:00:23,430 operators and indecision. 3 00:00:23,460 --> 00:00:26,730 We want to talk about the other operators concept. 4 00:00:31,930 --> 00:00:40,240 Logical operators, logical operators are used to determine the logic between variables or values. 5 00:00:41,050 --> 00:00:48,130 They are used to combine two or more conditions or constraints or to complement the evaluation of the 6 00:00:48,130 --> 00:00:50,320 original condition in consideration. 7 00:00:52,360 --> 00:01:01,150 Logical operators and go length are logical and logical, old and logical nuts. 8 00:01:02,110 --> 00:01:03,820 Now let's go to this quote. 9 00:01:03,820 --> 00:01:07,480 Bring it on to illustrate how to use logical operators. 10 00:01:09,760 --> 00:01:19,990 First, define three variables and initialize them, for example, via X Common Y Z and initialize by 11 00:01:19,990 --> 00:01:24,490 the values 100, 200 and 300. 12 00:01:25,600 --> 00:01:29,200 In the first case, we want to check logical and operator. 13 00:01:29,500 --> 00:01:31,450 So the right FP 14 00:01:34,030 --> 00:01:47,890 x less than y logical and x unitard then z because we use phenomenological and operator returns. 15 00:01:47,890 --> 00:01:55,270 True value if both statements are true, means x less than Y is true and x greater downs. 16 00:01:55,270 --> 00:02:03,190 It is true and we know that if the answer of any statement is false, final result will be false. 17 00:02:03,640 --> 00:02:08,260 Now save the project and go to turn on and execute the program. 18 00:02:09,570 --> 00:02:15,090 So, Ron, the and go right back, is this mean that good? 19 00:02:17,730 --> 00:02:19,560 Now we can see the output. 20 00:02:20,670 --> 00:02:22,170 The result is false. 21 00:02:22,710 --> 00:02:26,710 In the first section, we want to check your weather is the variable. 22 00:02:26,730 --> 00:02:34,860 It's less than the variable y or not, which means weather is a hundred less than 200 and the result 23 00:02:34,860 --> 00:02:35,400 is true. 24 00:02:36,120 --> 00:02:42,570 And in the next session, we want to check whether is the variable is greater than the variable that 25 00:02:42,570 --> 00:02:47,490 or not, which means weather is 100 greater than 300 or not. 26 00:02:47,910 --> 00:02:49,290 And the result is false. 27 00:02:49,590 --> 00:02:56,700 So the logical and operator between true and false returns false value. 28 00:02:59,010 --> 00:03:03,390 In the second case, we want to check logical or operator. 29 00:03:03,690 --> 00:03:05,910 So first clear, last cold. 30 00:03:10,990 --> 00:03:12,730 So tried FP. 31 00:03:16,720 --> 00:03:29,830 X less than y logical or even greater than that, because we from logical all operate all return through 32 00:03:29,830 --> 00:03:36,550 value, if both statements are true and we know that if the answer of any statement is true, final 33 00:03:36,550 --> 00:03:37,690 result will be true. 34 00:03:38,140 --> 00:03:41,380 So save the project and execute the program. 35 00:03:41,950 --> 00:03:42,790 So be right. 36 00:03:42,790 --> 00:03:44,650 Go wrong. 37 00:03:45,070 --> 00:03:49,840 Beck is left me that go in the first section. 38 00:03:49,840 --> 00:03:56,350 We want to check whether is the variable that less than the variable y or not, which means Vector is 39 00:03:56,350 --> 00:03:59,710 100 less than 200 and the result is true. 40 00:04:00,670 --> 00:04:06,970 And in the next session, we want to check whether is the variable is greater than the variable Z or 41 00:04:06,970 --> 00:04:13,450 not, which means Vector is 100 greater than 300 or not, and the result is false. 42 00:04:13,810 --> 00:04:21,010 So the logical or operator between true and false return, true value term case. 43 00:04:21,400 --> 00:04:26,470 In this case, if you want to check logical not so first year the last quote. 44 00:04:30,190 --> 00:04:30,710 Right. 45 00:04:30,730 --> 00:04:37,690 Iffy, logical, not open and close Francis's. 46 00:04:38,680 --> 00:04:43,060 Is equal to y logical and. 47 00:04:45,240 --> 00:04:47,460 It's greater than that. 48 00:04:50,300 --> 00:04:50,680 OK. 49 00:04:51,110 --> 00:04:58,520 Because we use from logic and not operate or reverse the result returns false if the result is true 50 00:04:58,760 --> 00:05:01,610 or returns true if the result is false. 51 00:05:02,060 --> 00:05:06,410 So we they could save the project and execute the program. 52 00:05:09,500 --> 00:05:14,150 Now we can see the output result is true in the first section. 53 00:05:14,330 --> 00:05:23,390 We want to check whether is the variable X equal to Y or not, which means whether is 100 equals 200 54 00:05:23,600 --> 00:05:25,100 and the result is false. 55 00:05:25,670 --> 00:05:31,370 And in the next section, we want to check whether is the variable is greater than the variable is it 56 00:05:31,370 --> 00:05:36,500 or not, which means whether is 100 greater than 300 or not. 57 00:05:36,830 --> 00:05:38,180 And the result is false. 58 00:05:38,660 --> 00:05:47,230 So the logical and operator between false and false return, false value and logical not to play true 59 00:05:47,240 --> 00:05:48,560 false value is true. 60 00:05:48,770 --> 00:05:50,810 So the final result is true. 61 00:05:51,530 --> 00:05:58,970 Okay, we were able to explain the definition of logical operators and give examples in order not to 62 00:05:58,970 --> 00:06:00,420 prolong the time of decision. 63 00:06:00,440 --> 00:06:04,130 We will finish it and we will continue the content in the next session. 64 00:06:04,250 --> 00:06:04,790 Goodbye.