1 00:00:00,150 --> 00:00:07,200 And actually going to study about the countries statements in C++, self-controlled statements that 2 00:00:07,200 --> 00:00:12,990 are used when we want to change the way of execution of a program, suppose we have some conditions 3 00:00:12,990 --> 00:00:17,790 in our program and we have to change the way the program is currently executing. 4 00:00:17,970 --> 00:00:21,090 If that condition isn't meant, I need to do something. 5 00:00:21,210 --> 00:00:25,710 If the condition is not met, I need to do something for that kind of instances. 6 00:00:25,710 --> 00:00:27,450 We are using and bold statements. 7 00:00:28,410 --> 00:00:33,300 So we will be having a detailed look into cantors statements and the type of control statements. 8 00:00:33,660 --> 00:00:37,680 Then you will get more idea of what this meant by those statements. 9 00:00:37,950 --> 00:00:45,660 So talking about the can ball state Rennison C++, there are mainly two types of candidate statements. 10 00:00:45,690 --> 00:00:48,450 One is if statement and that is straight statement. 11 00:00:48,630 --> 00:00:50,640 And together you can see more of each statement. 12 00:00:51,060 --> 00:00:53,220 There are few variance in each statement. 13 00:00:53,220 --> 00:00:58,260 That's actually these statements if this necessarily been impressive. 14 00:00:58,500 --> 00:01:04,560 So they are debating and this obvious statement and next to switch statement, we will be going into 15 00:01:04,560 --> 00:01:06,000 day to each of this. 16 00:01:06,360 --> 00:01:07,950 So let's move on to that. 17 00:01:08,520 --> 00:01:12,840 So what is the use of if statement you can clearly see or hear? 18 00:01:14,030 --> 00:01:19,430 So if statements are used when we want to have if we have some condition. 19 00:01:20,850 --> 00:01:28,080 Then if that condition is true, then if you if I want to do something, then it will go to that. 20 00:01:29,150 --> 00:01:34,010 True part of that statement, and after that, it will go to that next statement. 21 00:01:34,820 --> 00:01:38,150 So this will happen or leave that condition is met. 22 00:01:39,440 --> 00:01:47,420 So if it is not true, if the condition is not true, it will go down and execute the next statement. 23 00:01:47,960 --> 00:01:56,750 This block will not be executed so widely used if it's like if I have some condition, suppose if I 24 00:01:56,750 --> 00:02:01,430 have a condition like this, let me go back. 25 00:02:03,970 --> 00:02:09,670 Let me get the laser pointer for you and for you, then I'm going to help you. 26 00:02:11,620 --> 00:02:12,340 So. 27 00:02:13,490 --> 00:02:25,370 In a situation like this, if value of a greater then fine, then print out a yes, Don Quixote. 28 00:02:25,640 --> 00:02:26,780 That's my condition. 29 00:02:28,050 --> 00:02:33,090 So a lot of like we will be giving a value of equal to three. 30 00:02:34,260 --> 00:02:39,890 Now, see what will happen if equaled three, then next state in the news, if it greater than five 31 00:02:40,050 --> 00:02:42,450 or three greater than five is false. 32 00:02:42,660 --> 00:02:47,190 So it will skip then day of these statements and go to that statement. 33 00:02:47,190 --> 00:02:53,940 I would say this if blocked by Scott in today's name, then this condition is true. 34 00:02:54,180 --> 00:03:00,930 So then it will print now because this will go to that it blocked. 35 00:03:01,500 --> 00:03:07,020 So what happens to that block or leave condition is met or condition is true. 36 00:03:07,380 --> 00:03:12,300 That block will be executed and as it will go to that next statement. 37 00:03:12,660 --> 00:03:16,620 So in C++, how you can use your statement, this is that index. 38 00:03:16,830 --> 00:03:27,210 If keyword then put that condition in a bracket, then to block the next dividend of if it's if any 39 00:03:27,210 --> 00:03:27,840 statement. 40 00:03:28,080 --> 00:03:33,150 So it's also similar to if but the main differences. 41 00:03:33,630 --> 00:03:37,590 If the condition is met, it will execute the roadblock. 42 00:03:37,860 --> 00:03:41,850 If the condition is not met, it will execute that, yes, block. 43 00:03:42,090 --> 00:03:49,050 So suppose if this is the case, if that number, if it is greater than three. 44 00:03:50,290 --> 00:03:51,940 Then print a. 45 00:03:56,320 --> 00:03:57,010 Yes. 46 00:03:59,880 --> 00:04:00,990 You have to print. 47 00:04:03,050 --> 00:04:03,620 CEO. 48 00:04:06,480 --> 00:04:07,100 Yeah. 49 00:04:09,560 --> 00:04:12,020 Not greater than. 50 00:04:14,840 --> 00:04:15,120 Three. 51 00:04:16,460 --> 00:04:24,860 These the NATO, so I will be giving a quarter to then what happen if a equaled to this condition is 52 00:04:24,860 --> 00:04:26,900 due greater than three, which is why? 53 00:04:27,560 --> 00:04:32,900 So this blog will not be getting executed, but it will go to the next blog and it will execute that 54 00:04:33,170 --> 00:04:33,830 next blog. 55 00:04:33,950 --> 00:04:36,440 That just is not greater than three. 56 00:04:36,860 --> 00:04:45,050 Suppose if it is nine or eight Soyuz eight, then the statement eight greater than three will be the 57 00:04:45,050 --> 00:04:45,590 statement. 58 00:04:46,040 --> 00:04:47,030 So it is true. 59 00:04:47,180 --> 00:04:55,820 So it will execute code that will bring to the value of that is age by their statement cannot be executed. 60 00:04:56,000 --> 00:05:02,860 So here in the floor also, it's clear say if the condition is true, then that true block is executed. 61 00:05:03,230 --> 00:05:10,460 Is that yes, block is executed and then it moves to the next set up statements. 62 00:05:12,040 --> 00:05:18,520 Now we have these as if statements, so this is not a U.S. military statement, but to begin demanding 63 00:05:18,520 --> 00:05:25,960 preconditions, say if a condition is met, then that conditions it blog will be executed, then we 64 00:05:25,990 --> 00:05:28,750 have to begin given another condition. 65 00:05:28,960 --> 00:05:34,040 If this condition is not true, it will check this condition and if it is true, then it will execute 66 00:05:34,040 --> 00:05:34,630 that block. 67 00:05:35,850 --> 00:05:39,870 Then if both of these conditions are not true, then it will execute that. 68 00:05:40,050 --> 00:05:40,830 In a statement. 69 00:05:41,010 --> 00:05:46,320 So multiple levels of as simple as possible, like if one foundation is an argument, you can check 70 00:05:46,320 --> 00:05:47,760 on another condition again. 71 00:05:47,760 --> 00:05:51,120 You can read my morality fine by another condition and take ticket. 72 00:05:51,450 --> 00:05:58,860 Similarly, you can have multiple conditions, and if any of these conditions are met, that will be 73 00:05:58,860 --> 00:06:04,380 executed if not meant that last year's blog will be executed. 74 00:06:04,650 --> 00:06:06,930 Maybe to see this program in action? 75 00:06:07,140 --> 00:06:10,860 Do I understand the concept, a concept of if statements? 76 00:06:11,520 --> 00:06:21,090 So here again, see that this one also flowchart, but also so it will execute that condition. 77 00:06:21,300 --> 00:06:23,730 If it is true, it will execute bad conditions. 78 00:06:23,730 --> 00:06:29,280 Body if it is passed, it will text the step next expression and then it is. 79 00:06:29,280 --> 00:06:32,180 If it is true, it will execute that body. 80 00:06:32,440 --> 00:06:34,710 Yes, it will again go to the condition. 81 00:06:34,710 --> 00:06:40,200 Check if that on my brain, like a first statement is coming up. 82 00:06:40,560 --> 00:06:41,930 This will go on like this. 83 00:06:41,940 --> 00:06:47,040 So if it is a final as a condition, be objecting. 84 00:06:47,400 --> 00:06:50,700 If it is not true, then it will go to that statement.