1 00:00:13,080 --> 00:00:17,940 Hello and welcome to go blank or get on a language course in the previous session. 2 00:00:18,180 --> 00:00:24,690 We talked about Aether statement and in this session, we want to talk about the others decision making 3 00:00:24,690 --> 00:00:25,320 concept. 4 00:00:29,530 --> 00:00:38,170 If as a statement, the if a statement alarm tells us that if a condition is true, it will execute 5 00:00:38,170 --> 00:00:39,640 a block of statements. 6 00:00:40,120 --> 00:00:43,390 And if the condition is false, it won't. 7 00:00:43,780 --> 00:00:48,700 But what if we want to do something else if the condition is false? 8 00:00:49,270 --> 00:00:51,440 Here comes the Elsa statement. 9 00:00:52,120 --> 00:00:58,090 We can use the Elsa statement with if a statement to execute a block of court when the condition is 10 00:00:58,090 --> 00:00:58,660 false. 11 00:00:59,680 --> 00:01:03,700 Now you can see the flow diagram of if, as the statement. 12 00:01:05,700 --> 00:01:12,450 If the condition evaluates to true, then the if block of code will be executed and if the condition 13 00:01:12,450 --> 00:01:16,620 evaluates to false, then the LC block of code is executed. 14 00:01:17,370 --> 00:01:23,550 Now let's go to these schools for a get on and illustrate how to use, if else, statement. 15 00:01:25,770 --> 00:01:26,150 OK. 16 00:01:26,430 --> 00:01:33,720 In this example, we want to print a message based on if Alice's statement first defined two variables 17 00:01:33,720 --> 00:01:42,060 like that a by the tight and initialize 8.30 value and go to the next line and define, I know that 18 00:01:42,060 --> 00:01:51,900 many of them like Bad B by the Time Inc and initialize it by 20 now right conditioned by if as a statement 19 00:01:51,990 --> 00:02:01,560 first defined if, like Eve, and set the condition a less than B so city statement, for example, 20 00:02:01,560 --> 00:02:08,940 if b a value is less than. 21 00:02:10,980 --> 00:02:11,730 Be that you. 22 00:02:13,070 --> 00:02:23,690 And go out of your blood and sit as black, so right as open and close can the races and sit a statement 23 00:02:23,690 --> 00:02:37,100 for this blood, for example, if p a value is greater than B value. 24 00:02:40,160 --> 00:02:40,510 OK. 25 00:02:41,360 --> 00:02:47,120 If the condition has a true value, so the if plug will be executed, otherwise the exploit will be 26 00:02:47,120 --> 00:02:55,190 executed, reformat the code, save the project and execute the program, go to a terminal and run the 27 00:02:55,190 --> 00:02:56,360 program by the comment. 28 00:02:56,360 --> 00:02:59,710 Go round the back is this may go. 29 00:03:02,240 --> 00:03:03,980 Now you can see the output. 30 00:03:03,980 --> 00:03:06,380 A value is greater than the value. 31 00:03:06,980 --> 00:03:11,060 The value of the variable A is greater than the value of the variable be. 32 00:03:11,510 --> 00:03:14,240 It means throw greater than 20. 33 00:03:14,600 --> 00:03:22,010 So our condition returns false value and the statesman's inside the LS block are executed and printed. 34 00:03:22,010 --> 00:03:28,580 The message they value is greater than be value in order not to prolong the time of decision. 35 00:03:28,760 --> 00:03:32,750 We will finish it and we'll continue the content in the next session. 36 00:03:32,870 --> 00:03:33,440 Goodbye.