 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. Students must watch the following videos on the functions, here I specified the links of the videos. Now in this session we see the problem statements, write a C program to print all the perfect numbers in the given range using the function. Before seeing the actual code on the editor, first of all we see what is meant by perfect number. Perfect number means the sum of its positive divisor excluding the original number. If it is equal to the original number then we can say that the given number is a perfect number. Okay, here the 28 is the perfect number, the first of all we calculate the divisor of the 28. The 28 divisors are 1, 2, 4, 7, 14 and 28, but the sum of the original sum of the divisor excluding the original number. So here when we calculate the sum of the divisor, here we exclude the 28. So the sum of 1, 2, 4, 7 and 14 is equal to the 28. So here the sum and the original number is both are same. So that is why here the 28 is a perfect number. Suppose here the given range is there, the perfect numbers in the 1 to 100 ranges are 6 and 28. Okay, two perfect numbers in the given range, how we check the given numbers are the perfect number or not using function. So here we open the code block, first we create the new project, then click on the console application, select the language C, click on the next, give the project name, perfect, then click on the next button, then click on the finish. In the left hand side the project is created, then double click on the main file here. First of all we declare the two functions, so feature check perfect. First of all we write down the function for checking the perfect, here we pass one parameter of integer type to that function, then end with the semicolon, this is a function declaration. Afterward we write down one function declaration, perfect number. So here we pass the two parameter, starting limit and ending limit, integer ending limit to that function, here we declare the two functions, okay. Next in the main function we take two variables, starting limit and ending limit, okay. Here we display one message on the screen, enter the starting limit, enter the starting limit and that value is stored in the variable stl, so here we use the format pacifier per sendee and that value is stored in the stl, then end with the semicolon, next we display one more message on the screen, enter ending limit, ending limit, here we use the scanner function per sendee and that value is stored in the enl, next here we display one message on the screen, perfect numbers between per sendee, per sendee to per sendee r, that value is stored in the stl and endl and limit, okay. And here we call the function perfect number and here we pass the two parameter, perfect number, here we specify the perfect number and here we pass the starting limit and ending limit to that function, now after one we write down the function definition for check perfect, here we pass one parameter of type integer, here we check the actual perfect number, so here we take two variables i, i fault is a loop variable and we calculate the sum for storing the sum we take one more variable sum, so we here use the for loop, here i will be starting from 1, i is less than till n1 and then i++ every time, here we use the if decision statement, here if n1 mod by i equal to equal to 0, then we calculate the sum, so sum equal to sum plus i, here i means what we add the sum, after that after processing finally in some variable it stores sum of its positive divisors, then after for loop here we check if sum equal to equal to original number, if it is then here we return the value 1, otherwise we return the value 0, 0 to the function, this is the function to check the perfect number, then here we write one more function void perfect number, here we pass the two parameters integer, start limit and integer end limit, here we use the for loop for iterating from starting limit till ending limit, so here we write down stl means what starting limit to end limit, here we call the function check perfect and where we pass the starting limit to that function, here we display on the screen the divisor the perfect number devices, percent d and here we pass the stl end with the semicolon and here we increment the starting limit, after that we compile this program, so here the starting limit is 1 and ending limit is 100, so the perfect number between the 1 to 100 is 6 and 28, here we specify this slash t, the perfect number between 1 to 100 are 6 and 28, now after seeing this program, can you write a C program to check the given number is the amstrum number or not, pause this video and think about it by using function, so here first of all we write the written type of the function, here we specify the integer as written type of the function and we give the name to that function as a check amstrum and for that we pass one parameter of integer type, here we check or declare variables LD means last digit, sum for soaring the sum and number, here we initialize the sum to the 0, here after iterating original number it becomes 0, so that's why here initialize to the original number n1, here we use the value while num1 num is not equal to 0, we do the processing, so here first of all we calculate the last digit of the number, so that's why here number mod by 10, here we apply the mod operator and the given number last digit is stored in the LD, after that calculate the cube of the last digit and add to the sum and finally we remove that number from the original number, so that's why here we specify the division operator, so num equal to num divided by 10 and then then we here return the value n1 equal to equal to sum to the function change the number, now these are the references, thank you.