Hello and welcome to go blank or get on a language course in the previous session.
We talked about Aether statement and in this session, we want to talk about the others decision making
concept.
If as a statement, the if a statement alarm tells us that if a condition is true, it will execute
a block of statements.
And if the condition is false, it won't.
But what if we want to do something else if the condition is false?
Here comes the Elsa statement.
We can use the Elsa statement with if a statement to execute a block of court when the condition is
false.
Now you can see the flow diagram of if, as the statement.
If the condition evaluates to true, then the if block of code will be executed and if the condition
evaluates to false, then the LC block of code is executed.
Now let's go to these schools for a get on and illustrate how to use, if else, statement.
OK.
In this example, we want to print a message based on if Alice's statement first defined two variables
like that a by the tight and initialize 8.30 value and go to the next line and define, I know that
many of them like Bad B by the Time Inc and initialize it by 20 now right conditioned by if as a statement
first defined if, like Eve, and set the condition a less than B so city statement, for example,
if b a value is less than.
Be that you.
And go out of your blood and sit as black, so right as open and close can the races and sit a statement
for this blood, for example, if p a value is greater than B value.
OK.
If the condition has a true value, so the if plug will be executed, otherwise the exploit will be
executed, reformat the code, save the project and execute the program, go to a terminal and run the
program by the comment.
Go round the back is this may go.
Now you can see the output.
A value is greater than the value.
The value of the variable A is greater than the value of the variable be.
It means throw greater than 20.
So our condition returns false value and the statesman's inside the LS block are executed and printed.
The message they value is greater than be value in order not to prolong the time of decision.
We will finish it and we'll continue the content in the next session.
Goodbye.