Hello and welcome to Golang programming language course in the previous session, we talked about if
as a statement and in this session, we want to talk about the other decision making concert.
This that if a statement, it is always legal in gold programming languages to nest, if Elsa statements,
which means you can use Von F or else if a statement inside another, if all else, if statements,
if the first condition evaluates to true, then the if block of condition one will execute and in the
first, if black, it exists and all that is blood.
So if the condition to value a value is true, also if luck of second condition will execute to now,
let's go to the escort program to illustrate how to use miss that if a statement.
First defined two variables like that a by the tight end and initialize it by 300 and define another
variable life via B by the time end and initialize eight point five hundred.
In this case, we want to write myth that if a statement so we right first condition is a equal equals
300.
So set a statement for the statement of this.
If like we want to check if condition is true, set another condition like Eve.
Be Equal Equal 500, so set in a statement.
FP value of a is three hand-reared and value of me is five hundred and go out of the that if block and
display the variable is A and B values.
So we write f f.
A you call first in the back explosion and said Avery Idle and go to the next line and display that
b variable value, so be right if F.
Be value.
Colin Firth and D and set B value watching reform at the court, saved the project and executed the
program, now go to terminal and run the program by the common goal.
Ron Duck's back as this may not go.
Now we can see the output value of a is 300 and value of 500.
A value is 300.
B values five times the value of the variable A is 300.
So the first condition, a value is true value and compiler girl to execute.
The first is block.
In this block, it exists.
Another condition that evaluates true because Variable B has 500 value.
So the statements inside the second, if below, are executed and printed.
The message value of a is 300 and the value of B is five hundred.
When the compiler go out from the first div block, it will be executed to print F function.
A value is 300 and P values five hundred.
In this case, we could define this that if statement, in order not to prolong the time of decision,
we will finish it and we will continue the content in the next session.
Goodbye.