Hello and welcome to the go like programming language course in the previous session, we talked about
create a simple function in this session, we want to talk about the other functions concept.
Function with parameters.
Parameters are specified within the pain of plant disease in the function definition separated by commas
when we call the function, we supply the values in the saying they are parameter is just like a variable.
Parameters are specified after the function name inside the plant is this you can add as many parameters
as you want inside the function.
Now you can see the syntax.
Go to the school program and illustrate how to use function parameters.
First, creating it function, the two parameters of each time that adds together, for example,
forage at
each type of it, is it and why type of it is it?
Now define a variable named total debt as towards sum of two variables total time Colin equals x plus
y.
Now display the value of total variable.
Refer to the title of X plus y equals person D lowercase and sets the variable total.
Reformat the code and save the project.
Now go to the main function and in walked and function at and set to end values as arguments inside
it.
For example, 20 and 30.
Now reformat the code, save the project and execute the program.
Now we can see the output.
We could define the function named at that axis to enter value as parameters and sum them together and
display the result of it.
Important note if definitions with names that is sought in an uppercase letter will be exported to other
packages.
If the function name starts with the lowercase letter, it won't be exported to other packages, but
you can call this function within the same package in order not to prolong the time of decision.
We will finish finished and we will continue the content in the next session.
Goodbye.