And actually going to study about the countries statements in C++, self-controlled statements that
are used when we want to change the way of execution of a program, suppose we have some conditions
in our program and we have to change the way the program is currently executing.
If that condition isn't meant, I need to do something.
If the condition is not met, I need to do something for that kind of instances.
We are using and bold statements.
So we will be having a detailed look into cantors statements and the type of control statements.
Then you will get more idea of what this meant by those statements.
So talking about the can ball state Rennison C++, there are mainly two types of candidate statements.
One is if statement and that is straight statement.
And together you can see more of each statement.
There are few variance in each statement.
That's actually these statements if this necessarily been impressive.
So they are debating and this obvious statement and next to switch statement, we will be going into
day to each of this.
So let's move on to that.
So what is the use of if statement you can clearly see or hear?
So if statements are used when we want to have if we have some condition.
Then if that condition is true, then if you if I want to do something, then it will go to that.
True part of that statement, and after that, it will go to that next statement.
So this will happen or leave that condition is met.
So if it is not true, if the condition is not true, it will go down and execute the next statement.
This block will not be executed so widely used if it's like if I have some condition, suppose if I
have a condition like this, let me go back.
Let me get the laser pointer for you and for you, then I'm going to help you.
So.
In a situation like this, if value of a greater then fine, then print out a yes, Don Quixote.
That's my condition.
So a lot of like we will be giving a value of equal to three.
Now, see what will happen if equaled three, then next state in the news, if it greater than five
or three greater than five is false.
So it will skip then day of these statements and go to that statement.
I would say this if blocked by Scott in today's name, then this condition is true.
So then it will print now because this will go to that it blocked.
So what happens to that block or leave condition is met or condition is true.
That block will be executed and as it will go to that next statement.
So in C++, how you can use your statement, this is that index.
If keyword then put that condition in a bracket, then to block the next dividend of if it's if any
statement.
So it's also similar to if but the main differences.
If the condition is met, it will execute the roadblock.
If the condition is not met, it will execute that, yes, block.
So suppose if this is the case, if that number, if it is greater than three.
Then print a.
Yes.
You have to print.
CEO.
Yeah.
Not greater than.
Three.
These the NATO, so I will be giving a quarter to then what happen if a equaled to this condition is
due greater than three, which is why?
So this blog will not be getting executed, but it will go to the next blog and it will execute that
next blog.
That just is not greater than three.
Suppose if it is nine or eight Soyuz eight, then the statement eight greater than three will be the
statement.
So it is true.
So it will execute code that will bring to the value of that is age by their statement cannot be executed.
So here in the floor also, it's clear say if the condition is true, then that true block is executed.
Is that yes, block is executed and then it moves to the next set up statements.
Now we have these as if statements, so this is not a U.S. military statement, but to begin demanding
preconditions, say if a condition is met, then that conditions it blog will be executed, then we
have to begin given another condition.
If this condition is not true, it will check this condition and if it is true, then it will execute
that block.
Then if both of these conditions are not true, then it will execute that.
In a statement.
So multiple levels of as simple as possible, like if one foundation is an argument, you can check
on another condition again.
You can read my morality fine by another condition and take ticket.
Similarly, you can have multiple conditions, and if any of these conditions are met, that will be
executed if not meant that last year's blog will be executed.
Maybe to see this program in action?
Do I understand the concept, a concept of if statements?
So here again, see that this one also flowchart, but also so it will execute that condition.
If it is true, it will execute bad conditions.
Body if it is passed, it will text the step next expression and then it is.
If it is true, it will execute that body.
Yes, it will again go to the condition.
Check if that on my brain, like a first statement is coming up.
This will go on like this.
So if it is a final as a condition, be objecting.
If it is not true, then it will go to that statement.