1 00:00:13,030 --> 00:00:16,450 Hello and welcome to Golang programming language course. 2 00:00:16,870 --> 00:00:22,510 In the previous session, we talked about Nest that if a statement and in this session, we want to 3 00:00:22,510 --> 00:00:25,420 talk about the other's decision making concept. 4 00:00:29,370 --> 00:00:38,500 If else, if else, a statement that if and if as the statement allows to combine multiple, if else 5 00:00:38,610 --> 00:00:47,220 statements, the if the statements are executed from the top down as soon as one of the conditions controlling 6 00:00:47,220 --> 00:00:55,290 the if is true, the statement associated with that if is executed and the rest of the latter is bypassed. 7 00:00:55,560 --> 00:01:00,450 If now, if the condition is true, then the final as the statement will be executed. 8 00:01:02,360 --> 00:01:09,830 Now you can see the flow diagram for Eve, as if else statement, then throwing it on Ron's first computer 9 00:01:09,830 --> 00:01:17,330 checks, if condition, then if it is evaluated as true, the body of if condition will execute. 10 00:01:17,360 --> 00:01:23,170 Otherwise, the compiler will go to as if condition and check the value of it. 11 00:01:23,660 --> 00:01:30,320 In this case, if it is evaluated as true, the compiler will execute the body of ElSaffar statement. 12 00:01:30,590 --> 00:01:38,090 Otherwise, the compiler will go to either as if plaques if own, as if a statements would be evaluated 13 00:01:38,090 --> 00:01:41,990 as false, then as block will be executed fine. 14 00:01:42,890 --> 00:01:50,330 Now let's go to a school program to illustrate how to use from if an if else statement. 15 00:01:51,620 --> 00:01:58,670 In this case, we defined two variables by the same values, for example, that a by the tight end and 16 00:01:58,700 --> 00:02:07,280 initialize it by 100 and define another variable like that be by the tight end and initialize it by 17 00:02:07,280 --> 00:02:08,390 100 again. 18 00:02:09,650 --> 00:02:13,670 Now we want to write, if else even else statement. 19 00:02:13,940 --> 00:02:27,020 So first, define if condition is a less than be, so go to calibrate, says and write a statement for 20 00:02:27,020 --> 00:02:27,800 this condition. 21 00:02:27,830 --> 00:02:36,830 So we write FP, a value is less than be value 22 00:02:39,710 --> 00:02:45,280 and go out of the f block condition and define it as if condition. 23 00:02:45,290 --> 00:02:52,250 So we write as eve and define condition for display. 24 00:02:52,280 --> 00:03:00,410 For example, a equal equals b go to charity braces and set a statement for this condition. 25 00:03:00,410 --> 00:03:09,380 For example, FP a value is equal p value. 26 00:03:11,060 --> 00:03:15,380 And go out of the Earth if black and defined as black. 27 00:03:15,560 --> 00:03:22,770 So we ride as and set a statement for this black soldier, right? 28 00:03:22,800 --> 00:03:37,730 AFP A value is greater, then be that, OK, reformat the court, save the project and execute the program. 29 00:03:38,330 --> 00:03:42,140 So go to terminal and run program by the command. 30 00:03:42,140 --> 00:03:46,520 Go Run Duct Backslash Main Duct Go. 31 00:03:48,710 --> 00:03:50,690 Now we can see the output. 32 00:03:51,140 --> 00:03:52,610 A value is equal. 33 00:03:52,610 --> 00:04:00,170 Be value in this example because Variable A. and Variable B have the same values. 34 00:04:00,320 --> 00:04:07,430 So the else, if black will be executed, OK, we could define Eve as if else the statement. 35 00:04:07,640 --> 00:04:13,280 In order not to prolong the time of decision, we will finish it and we will continue the content in 36 00:04:13,280 --> 00:04:14,150 the next session. 37 00:04:14,270 --> 00:04:14,750 Goodbye.