Hello and welcome to Golang programming language course.
In the previous session, we talked about Nest that if a statement and in this session, we want to
talk about the other's decision making concept.
If else, if else, a statement that if and if as the statement allows to combine multiple, if else
statements, the if the statements are executed from the top down as soon as one of the conditions controlling
the if is true, the statement associated with that if is executed and the rest of the latter is bypassed.
If now, if the condition is true, then the final as the statement will be executed.
Now you can see the flow diagram for Eve, as if else statement, then throwing it on Ron's first computer
checks, if condition, then if it is evaluated as true, the body of if condition will execute.
Otherwise, the compiler will go to as if condition and check the value of it.
In this case, if it is evaluated as true, the compiler will execute the body of ElSaffar statement.
Otherwise, the compiler will go to either as if plaques if own, as if a statements would be evaluated
as false, then as block will be executed fine.
Now let's go to a school program to illustrate how to use from if an if else statement.
In this case, we defined two variables by the same values, for example, that a by the tight end and
initialize it by 100 and define another variable like that be by the tight end and initialize it by
100 again.
Now we want to write, if else even else statement.
So first, define if condition is a less than be, so go to calibrate, says and write a statement for
this condition.
So we write FP, a value is less than be value
and go out of the f block condition and define it as if condition.
So we write as eve and define condition for display.
For example, a equal equals b go to charity braces and set a statement for this condition.
For example, FP a value is equal p value.
And go out of the Earth if black and defined as black.
So we ride as and set a statement for this black soldier, right?
AFP A value is greater, then be that, OK, reformat the court, save the project and execute the program.
So go to terminal and run program by the command.
Go Run Duct Backslash Main Duct Go.
Now we can see the output.
A value is equal.
Be value in this example because Variable A. and Variable B have the same values.
So the else, if black will be executed, OK, we could define Eve as if else the 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.