1 00:00:13,350 --> 00:00:18,960 Hello and welcome to go down to the academy language course in the preview session, we talked about 2 00:00:18,960 --> 00:00:21,980 continuous statements and indecision. 3 00:00:22,000 --> 00:00:24,900 We want to talk about the others controversial statements. 4 00:00:28,530 --> 00:00:36,660 Go to a statement to go to your statement and go programming language channel wise and unconditional 5 00:00:36,660 --> 00:00:41,460 jump from the Go two to a labelled the statement in the same function. 6 00:00:42,360 --> 00:00:49,800 Use of go to a statement is highly discouraged in any programming language because it becomes difficult 7 00:00:49,800 --> 00:00:57,420 to trace the comfort flow of the program, making the program difficult to understand and modify any 8 00:00:57,420 --> 00:01:01,920 program that uses a go to can be written using some other construct. 9 00:01:03,000 --> 00:01:05,130 Now you can see the syntax 10 00:01:07,890 --> 00:01:08,340 here. 11 00:01:08,520 --> 00:01:17,250 Label can be any plain text except go keyword, and it can be set anywhere and go program above or below 12 00:01:17,250 --> 00:01:18,510 to go to a statement. 13 00:01:20,550 --> 00:01:25,950 Now let's go to this school with Cary Grant to illustrate how to use love, go to a statement. 14 00:01:29,830 --> 00:01:37,900 First, define a variable named X and initialize it by zero values, so we write that X by the tight 15 00:01:37,900 --> 00:01:47,170 end and initialize it by zero value, create a loop that works as a y loop and define the condition 16 00:01:47,170 --> 00:01:54,910 and programmable continues as long as the value of X is less than eight and print value of X variable 17 00:01:55,180 --> 00:01:58,190 and then add one unique to X variable. 18 00:01:58,510 --> 00:02:00,010 Now do the following. 19 00:02:00,670 --> 00:02:11,320 First, define a label like labor long labor while column and go to the next line and define a value 20 00:02:11,330 --> 00:02:15,130 loop, so write for and set conditions. 21 00:02:15,160 --> 00:02:19,780 In this case, it's less than eight or 10 in curly braces. 22 00:02:19,780 --> 00:02:22,150 And write our statement here. 23 00:02:23,080 --> 00:02:27,280 Now define our if luck solved right each. 24 00:02:28,120 --> 00:02:34,400 For example, it's equal, equal five cities statement for this. 25 00:02:34,420 --> 00:02:44,440 If like, for example, an X equals X plus one and now using go to statements, all right. 26 00:02:44,440 --> 00:02:48,580 Go to label one. 27 00:02:49,540 --> 00:03:02,860 And now go out of each block and displayed the very and sort of write f f value of X column first, 28 00:03:02,860 --> 00:03:09,060 then d back in and said, expand it. 29 00:03:10,810 --> 00:03:19,140 And in the next line, E-Trade, our biggest variable, one by one, all of Ryan Giggs plus plus okay, 30 00:03:19,480 --> 00:03:26,260 in four block, we define and if plug in set, if it's equally equal, five value add one value two 31 00:03:26,260 --> 00:03:30,790 x and go to two the label one position and continue the program. 32 00:03:31,240 --> 00:03:35,560 OK, leave for medical, save the project and execute the program. 33 00:03:35,890 --> 00:03:39,640 So go to terminal and run the program by the comment. 34 00:03:39,640 --> 00:03:43,390 Go from thought back to made that go. 35 00:03:46,120 --> 00:03:54,980 OK, now we can see the output value of X is zero one two three four six seven. 36 00:03:55,330 --> 00:03:59,500 And we can see the value of X equals five. 37 00:04:00,460 --> 00:04:07,990 The program runs and it's time first place the value of the X variable and then adds one unit to the 38 00:04:07,990 --> 00:04:11,440 variable X until the value of X equals five. 39 00:04:12,400 --> 00:04:20,530 In this case, the program enters the FBI and executes the commands inside the block and adds one units 40 00:04:20,530 --> 00:04:28,540 to east and jumps from one reputation and skips the value five and then go to the first of loop and 41 00:04:28,540 --> 00:04:30,880 check the value of X and continue. 42 00:04:31,300 --> 00:04:33,760 So we could define go to a statement. 43 00:04:34,390 --> 00:04:36,190 We have reached end of decision. 44 00:04:36,400 --> 00:04:40,330 I hope you take full advantage of this session until next edition. 45 00:04:40,360 --> 00:04:40,990 Goodbye.