 Hello everyone, today we are going to see the programs using function call by value. Learning outcome at the end of this session students will be able to write a C program using function call by value. Now here we see some examples on the code block using call by value. The first example we see is the calculating the addition of two numbers using function. So first we open the code block, here we first create the project, then click on the create new project, here we click on the console application, here we click the language C because we develop the program using C language, click on the next button, give the name to the project, here we give the project name demo and click on the next, then click on the finish button. After that we can see here our project is created, click on the sources, here the main file is created, click on that, here the main function is already defined, here we develop a program for addition of two numbers using function. So first we erase that printf statement, first we declare the function, so return type of that is the integer, the name of that function is the add and it takes the two parameters of type integers, so here we specify integer a comma integer b. So this is a function declaration, it all must end with the semicolon, after that we go inside the main function, in main function we created two variables for taking the input from the user, so we declare integer x comma integer y and end with the semicolon. Here we use the printf statement for displaying the message, here we display the message enter two numbers and we end with the semicolon canf statement for taking the input from the user scanf, that value is stored in the variable a, sorry that value is stored in the variable x and y and end with the semicolon. After that we call the function, so we call the function by taking the, by specifying the name of that function, here the name of the function is the add and we pass the actual value of that variable to the function and that value is stored in the variable x and y, so here we pass the x comma y, here x comma y are nothing but your actual parameters or we can say that actual arguments, here after that you can see that your function is returning the value of type integer, so we must store that value, for storing that value we use the one variable of type integer, this re result for storing that value and so here we use result equal to add x comma y, after that we display the message on the screen addition of two numbers and that value is stored in the variable result, then we save that file by clicking on the file and save everything, save file on the file or save everything, after that we define the function body, here function body we first declare the function header integer add, we pass the two parameter integer a comma integer b, here we declare one local variable for storing the result integer r, after that we add the two numbers a plus b and that value is stored in the variable r, so we can write the, so we can write r equal to a plus b or here we use the return statement for returning the value to the calling function, after we again save that file you can use a shortcut key control s, how that program is executed exactly we see, first the main function is executed in main function, the scan a function is executed, after that we call the function here, when we call the function the control is passed to that function body, here we call, here we call the function add, here we pass the actual values of x and y, then control comes here and that value is copied into the formal parameters a and b, here we done the addition and when here we use the return statement for returning the value to the calling function and that value is stored in the result, after that we compile that file, for compilation file we click on the build, here it shows the zero errors, zero warnings, then we run that file, click on again build, in build we click on the run, here it displays the message enter two numbers, here first we enter the first number 10 and second is the 20, so it displays the addition of two numbers 30, in this way we use the return statement and we pass the parameter to the function, now next we see the one another example of finding the largest number between two using function, again we create the project, create click on the file new or here click on the project, here again we click on the console application, click the C language, click on the next, give the name function 1, click on the next and click on the finish, again here the main function file is already created, we just remove the printf statement, for finding the largest number amongst two numbers, first we declare the function declaration, first we declare the function, the return type of that function is the integer, function name is the largest and it takes the two parameters of type integer, integer x comma integer y, now this is the function declaration in main function, we take the two input two variables of type integer a comma b and we here our function is returning the value, so here we create one another example result for storing the result, next we use the printf statement for taking the input from the user, here we display the message enter two numbers, then we take the scanf function, next we call the function, so here our function is returning the value, so result equal to largest and we pass the actual value restored in the variable a and b, now here a and b are the actual parameters, after that we display the message on the screen, largest number is and that value is stored in the result and we close the main function and we save that file, after that we write the function body, integer function name is the largest and it takes the two parameters of type integer, here we use the if-else statement for taking, here we use the statement if-else, if x greater than y, then return x, otherwise return y, return y, then again save that code, now when we call the function the value of a and b is copied into the formal parameter x and y, here we check whether value of x is greater than y, if it is greater than y then it returns the value x, otherwise return value y, next we compile that file by clicking on the build button, it shows the zero errors, zero warnings, then we run that file by clicking on the run, here we display the message enter two numbers, here we specify 23 and 10, so it display the message largest number is 23, in this way we use the return statement and we pass the parameter to the function, these are the references, thank you.