1 00:00:12,610 --> 00:00:19,150 Hello and welcome to Golang programming language course in the previous session, we talked about if 2 00:00:19,150 --> 00:00:25,570 as a statement and in this session, we want to talk about the other decision making concert. 3 00:00:29,930 --> 00:00:39,500 This that if a statement, it is always legal in gold programming languages to nest, if Elsa statements, 4 00:00:40,280 --> 00:00:47,690 which means you can use Von F or else if a statement inside another, if all else, if statements, 5 00:00:49,700 --> 00:00:58,280 if the first condition evaluates to true, then the if block of condition one will execute and in the 6 00:00:58,280 --> 00:01:02,130 first, if black, it exists and all that is blood. 7 00:01:02,170 --> 00:01:11,630 So if the condition to value a value is true, also if luck of second condition will execute to now, 8 00:01:11,630 --> 00:01:17,600 let's go to the escort program to illustrate how to use miss that if a statement. 9 00:01:21,440 --> 00:01:31,250 First defined two variables like that a by the tight end and initialize it by 300 and define another 10 00:01:31,250 --> 00:01:37,450 variable life via B by the time end and initialize eight point five hundred. 11 00:01:38,600 --> 00:01:47,180 In this case, we want to write myth that if a statement so we right first condition is a equal equals 12 00:01:47,180 --> 00:01:48,200 300. 13 00:01:49,040 --> 00:01:52,970 So set a statement for the statement of this. 14 00:01:52,970 --> 00:01:59,630 If like we want to check if condition is true, set another condition like Eve. 15 00:02:01,250 --> 00:02:07,580 Be Equal Equal 500, so set in a statement. 16 00:02:07,970 --> 00:02:23,840 FP value of a is three hand-reared and value of me is five hundred and go out of the that if block and 17 00:02:23,840 --> 00:02:26,690 display the variable is A and B values. 18 00:02:26,810 --> 00:02:28,130 So we write f f. 19 00:02:30,410 --> 00:02:40,700 A you call first in the back explosion and said Avery Idle and go to the next line and display that 20 00:02:40,700 --> 00:02:42,990 b variable value, so be right if F. 21 00:02:44,140 --> 00:02:45,940 Be value. 22 00:02:47,820 --> 00:02:58,500 Colin Firth and D and set B value watching reform at the court, saved the project and executed the 23 00:02:58,500 --> 00:03:02,780 program, now go to terminal and run the program by the common goal. 24 00:03:02,980 --> 00:03:05,670 Ron Duck's back as this may not go. 25 00:03:07,770 --> 00:03:14,280 Now we can see the output value of a is 300 and value of 500. 26 00:03:14,700 --> 00:03:16,890 A value is 300. 27 00:03:16,890 --> 00:03:21,690 B values five times the value of the variable A is 300. 28 00:03:22,020 --> 00:03:27,510 So the first condition, a value is true value and compiler girl to execute. 29 00:03:27,510 --> 00:03:28,860 The first is block. 30 00:03:29,280 --> 00:03:31,020 In this block, it exists. 31 00:03:31,020 --> 00:03:36,630 Another condition that evaluates true because Variable B has 500 value. 32 00:03:36,900 --> 00:03:41,790 So the statements inside the second, if below, are executed and printed. 33 00:03:41,790 --> 00:03:46,890 The message value of a is 300 and the value of B is five hundred. 34 00:03:47,190 --> 00:03:53,340 When the compiler go out from the first div block, it will be executed to print F function. 35 00:03:53,550 --> 00:03:56,940 A value is 300 and P values five hundred. 36 00:03:57,630 --> 00:04:04,080 In this case, we could define this that if statement, in order not to prolong the time of decision, 37 00:04:04,260 --> 00:04:08,040 we will finish it and we will continue the content in the next session. 38 00:04:08,220 --> 00:04:08,760 Goodbye.