Hi guys.
Welcome back.
In this section we're going to learn about the statements you see.
OK.
A statement is an instruction given to the computer to take specific action.
It must me to him.
Yes let me call it.
OK.
And there are three types of false statements which are available in C which is the first one is if
statement.
The second one is if a statement.
And the third one is said if in statement.
OK.
So we always will see one by one how it works.
And if statement this is the basic syntax.
OK.
If there would be a conditional here if this condition is true then this block of code will be executed.
OK.
And to me.
For example if this condition is to in the Valley is one if it is wanted to look at the value of zero.
OK.
So the sort I haven't mentioned here and if statements value the test as I mentioned earlier that statement
ever evaluates that this expression inside that pattern persists.
OK.
If the country this expression is true which is one this block of quality because you go to if it is
far easier to zero then this block of code is calling on.
That's OK.
So we'll see further along with the help of that.
So this is the basic basic program for a statement.
OK.
So what I'm doing here is
this is a variable with a digital right.
I'm just getting the H off of a user.
OK.
So what I'm going to use like this is does scan a function which is defined in the center file OK.
So I'm just getting the value of each I'm putting a condition here.
If age is greater than 80 I open district.
OK.
So before printing it are just to print what they used and taught here.
What are they using as a..
So in this value here an element that you're eligible to cast.
OK.
That's OK.
So we'll just try to compile this and see into your age.
So I'm mentioning as 19 C is giving the output.
OK.
Again I'm repeating I had just declared the variable.
Each variable each for the indigent.
Right.
So I'm just printing this in the console.
OK.
So I'm just taking the value from the user like and I'm checking it if condition I'm checking the value
or which was inputted by the user and seen like I'm just got the condition is like if it is more than
80 then I open this block of code and something will happen.
You've just written zero on the program will become.
OK so this is a very simple if statement.
OK.
So now we will see a false statement.
OK.
We will just try to build on top of this if it meant a free fill statement.
Hi guys.
In this session we're going to learn about a false statement.
OK.
And if it meant me having an option as rock below the syntax for different treatment if that's the expression
did missed to be executed is that despite this expression outcome is true.
Which means one if it'll be validation or here is distance test expression is true which means one then
this block of quality because dead else this block of code will be executed which means here is the
test expression is one which means to this block of code will be executed in case this is false which
means zero then this block will be executed.
OK so the only difference between you funny are in if you limit its expression on their block of quality
be executed and the else block will not be dead in the if statement.
Whereas if instead when there'll be an additional block will be dead.
So in case of justice the expression is false.
This block of code will be executed if it is true then this block of code will be executed.
OK so we'll see for that with the help of the program.
Oh we'll see one more example.
OK here what I'm doing here is the same almost the same program.
OK so here here little warning that if you just more than 18 we just mentioning you you're eligible
to cast a vote in case if I enter 90 for example it will cost a dollar.
It will print the message.
Congratulation you're eligible to cast a vote.
It gives you a entered something 16.
Then this rock of course should be excluded because it's false.
OK so again I'm coming reporting does it everyday and does it end up with a variable each.
I'm just entering.
This will be printed on the C console and I'm getting the value from the user.
And if the age is more than 18 then I will print this one.
If this is false if his age is less than 18 then I'll print this one.
OK so if this is true it will get and 1 and this will be a printer.
Also this will be printed.
OK certain 0 is a normal definition.
OK.
So let's let's execute.
This violates or no.
This this this option is going to exude.
No no.
Enter the H.
Now I'm pulling us 90.
You enter 19.
Congratulations you are eligible to cancel.
Okay so this is true then this is true.
That's why this block of treatment has been executed successfully.
Less than 80.
So then let's see like that this block of code is getting it is good.
Which means if I execute a user if a match if I gain 17 then this condition false which means it will
become and it will become zero.
You have zero means then this block of callable gives you good.
Let's see what happens.
Say sorry you are not eligible to cast.
So it check the condition 17.
Is it something is greater than 8 9 or is false.
Which means it returned 0 0 0.
That's where this block of code is not exactly destroyed.
Obviously if this condition is false zero then this block of code in Mexico.
So since this condition has failed so this block of both of us execute.
This is how we have to use a failed state emergency language.
Thanks for watching this video.
I'll catch you guys in the next video station.