A function is a group of statements that are written for performing a certain task which you may need to perform regularly. Whenever you want to perform the task, you can call the function.
Defining a Function
Here is how to define a function in the C programming language:
return_type function_name( parameter list ) {
body of the function
}
Return Type − The return_type defines the data type of the value that the function returns. The return_type is the keyword void if the functions do the operation needed but do not return any value.
Function Name − This is the name of the function.
Parameters − A parameter is like a placeholder. When a function is called, you pass a value referred to the parameter.
Function Body − The function body is a set of statements for performing a certain task.
If you want to learn C programming, then check out this C Programming Online Course by Intellipaat
Also, watch this YouTube tutorial on C programming: