1 00:00:01,980 --> 00:00:03,230 Hi this is for things that are. 2 00:00:03,240 --> 00:00:07,160 And welcome to the next video of discourse of Cartland programming series. 3 00:00:07,200 --> 00:00:13,580 Now in this video we will learn about the Raiders in case of Cortland now similar to Java and any other 4 00:00:13,590 --> 00:00:19,530 programming language we have for loop VI loop and do a loop in case of Cartland. 5 00:00:19,800 --> 00:00:24,030 And also we have break and continue statements to execute our called aspart. 6 00:00:24,060 --> 00:00:25,690 Our wish. 7 00:00:25,860 --> 00:00:28,010 Now first of all why do we need to. 8 00:00:28,230 --> 00:00:29,140 So as a beginner. 9 00:00:29,160 --> 00:00:31,250 You might ask this question. 10 00:00:31,260 --> 00:00:33,440 Now suppose you want to print Hello. 11 00:00:33,630 --> 00:00:35,080 So it's full effect fine. 12 00:00:35,100 --> 00:00:36,690 You can simply type in line. 13 00:00:36,690 --> 00:00:37,560 Hello. 14 00:00:37,560 --> 00:00:39,710 Now you want to print hello let's. 15 00:00:39,750 --> 00:00:42,860 Multiple times so you will simply type in line. 16 00:00:42,900 --> 00:00:46,070 Hello multiple times and in the output as well. 17 00:00:46,080 --> 00:00:46,790 You will get. 18 00:00:46,930 --> 00:00:48,070 Hello 4 times. 19 00:00:48,090 --> 00:00:52,140 Right as a beginner you will go for this option. 20 00:00:52,140 --> 00:00:55,090 But let me tell you this is not the way to do it. 21 00:00:55,170 --> 00:01:01,540 If you have some kind of factoring out word then in this situation we have to make use of loops. 22 00:01:01,600 --> 00:01:03,750 Or you can say the iterators. 23 00:01:03,750 --> 00:01:09,670 Now here to shake out what are the syntax of for loop like loop and do while loop. 24 00:01:09,690 --> 00:01:14,860 Now in case a for loop we have this syntax for followed by function. 25 00:01:14,950 --> 00:01:15,670 I. 26 00:01:15,780 --> 00:01:16,940 This is the ranges. 27 00:01:16,950 --> 00:01:22,660 Now this one dot Darkfall is actually the range that we already saw in the previous video. 28 00:01:22,830 --> 00:01:29,330 So I in one Dogbert for that simply means I will have the value of 1 2 3 and 4. 29 00:01:29,460 --> 00:01:33,770 Now inside this latest print hello for games like this. 30 00:01:33,870 --> 00:01:39,820 Now similarly while loop has its own syntax such as vyle is smaller than 5. 31 00:01:40,020 --> 00:01:43,500 Now here it is actually the counted very well. 32 00:01:43,530 --> 00:01:44,780 Now insert the value. 33 00:01:44,950 --> 00:01:49,460 Begin simply print hello and then incrementing the counter variable. 34 00:01:49,540 --> 00:01:55,020 I blissfulness and now at the end we have to wait to hear what they really do. 35 00:01:55,020 --> 00:01:57,960 This index is due followed by curly braces. 36 00:01:58,140 --> 00:02:03,410 And here we have light that will simply check for the condition and now insert this. 37 00:02:03,410 --> 00:02:06,420 We can simply print hello and then increment the counter. 38 00:02:06,600 --> 00:02:11,520 So the syntax of do why loop and why loop is exactly the same as that of Java. 39 00:02:11,520 --> 00:02:14,910 The only difference we will find is in case of for loop. 40 00:02:14,910 --> 00:02:17,930 Right and now let us check out the structure of the loop. 41 00:02:18,000 --> 00:02:24,390 So inside the loop structure we have Van Gundry very well like I and II here and also here. 42 00:02:24,590 --> 00:02:28,230 Right now Next we have a condition check. 43 00:02:28,350 --> 00:02:30,390 Now in case a for loop and by loop. 44 00:02:30,570 --> 00:02:35,610 First we are checking the condition and then only via exec the code. 45 00:02:35,670 --> 00:02:42,510 But in case of do a loop the first executing the code and then checking the condition right and then 46 00:02:42,510 --> 00:02:47,050 at last we have incrementing and decrementing of the counter such as. 47 00:02:47,050 --> 00:02:49,300 Here I bless this A-plus bliss. 48 00:02:49,320 --> 00:02:54,610 And here as well english so far Lou it is actually getting incremented internally. 49 00:02:54,780 --> 00:02:59,530 So this was all about the syntax of for loop and why loop and also do a loop. 50 00:02:59,910 --> 00:03:03,450 Now next let us not proceed and check out the loop control statements. 51 00:03:03,450 --> 00:03:04,510 In case of Cartland. 52 00:03:04,610 --> 00:03:10,860 So in Scotland we have the Greek statements Gunday new statements and also the returns statements that 53 00:03:10,860 --> 00:03:12,410 I will talk about it shortly.