 Hello, friends. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to explain how you can perform some of two numbers with help of functions in C-language. Before we start, just one information. If you go to description of this video, you will find links of various pillars related to C-language. Now, I'm going to explain how you can use function to perform this operation. So function has three parts. First is declaration, second is calling, and third is definition. Right? So I'm going to implement all these three parts in this example. So we need to perform some of two operations. So first time writing, declaration of function. So this is declaration of function. So here you can see it has three parts. This first part is written time. This first part is written time. This is function name. And these are the parameters that we need to pass. So inside parenthesis, I have mentioned 8 comma 8. It means this function will be receiving two integers as a parameter for addition. And this is a written type of this function. It means after calculation, this function will be returning an integer type of thing. So after this, I need to implement name. Then I'm declaring three variables ABC. Let's say A is 5 and B is 10. So I'm not receiving values from user. So that are simple statement. You can use printf scanf if you want to receive values from user. But for demonstration or example purpose, I have provided 5 and 10 into A and B aspect. Now I'm going to call some function. So this is the calling statement. Right? And the result will be available into C. So after this, I can write sum equals to percent B and C. And this way I have completed main function. After completion of main function, I need to define the process of this sum that is known as definition of the function. So after closing main, you can define the process which is known as function. So this way I can write this. So calling will transfer control to this definition. Value of A will be passed here. Value of B will be passed here. Right? And here instead of using A and B, you can use any other variables as well. So let's say if I want to use X, Y, so I can surely use X, Y here as well. So value of A will be stored into X. Value of B will be stored into Y. And here you can see I'm again using data type. Why so? Because here main is terminated and we are defining another block. So if we have separate block, so whenever you use different variables. So you always need to define the X. Right? Now let's say I'm declaring one more variable Z equals to X plus Y and then I am writing return Z. So this is our second function. So this way in C programming, you can divide main function into several parts with the help of function. Right? So I hope you understood how we can divide main into separate parts with the help of this function. So this is the name of function. It is having two parameters which are provided through main. Then process is completed. Now return keyword will throw this value to back to C variable. So whatever value is available inside Z variable will be stored into C. So calling transfers control to definition and after completion of definition, control is again transferred back to calling state. Right? So after receiving value from Z into C, we can print this value of C on output screen as output. So this way we have divided this part, this program into two parts. But it's main functions that it is some function main function is calling some so that it will pop and it will return output. And now I hope you understand. I hope you understood this is a written type. So it is returning in visa type value. These are parameters. So we have received them here. And this is functioning. We are using it in all three cases. Whether it is declaration or it is calling or it is definition. So this was the very simple example. By following this example, let's say if you want to calculate factorial by implementing function. So you will be applying calculation of factorial into other function that is separate to main. So let's say name of function will be factorial and here you will be implementing the loop and after calculation result will be transferred into main. So after implementing functions in C language, main will not be having actual logic. Main will be having input output and calling of the function actual logic will be transferred into the other function that you are going to implement. Right? So this way we can implement modular programming at both so that each module or each block that is also known as function will be having a space logic that will be executed. So I hope you understood how we can perform some of two numbers with a function in C language. If you want to watch more function related programs. So at the end of this video, you will find a link related to functions in each playlist. So open that link and you will find various programs or various explanations related to functions. How we can implement function related programs in C language. Do watch them so that you can understand it well and thank you for watching this video.