### Function in C Programming with Examples [Complete Guide]

Function:A function is a block of code that performs a specific task.

Every C program has at least one function, which is main().

A function executes its body (set of instructions) when it is called.

Parts of a function:There are four parts of a function

Return TypeName of the functionParametersFunction Body/DefinitionReturn Type:The type of data function returns after performing its functionality.

Any primitive data type can be used as return type. So return type may be int, float, double, char, long etc.

Name of the Function:Name of the function must show what the function is about. For example, if we want to make a function which simply adds some numbers, then the function name will be sum or summation or add just to show that the function simply adds numbers.

Parameters:Data to receive whenever the function called is known as parameters of the function. Parameters are enclosed in the round brackets with there primitive data types.

Function Body:Function body contains all the code to execu…

Every C program has at least one function, which is main().

A function executes its body (set of instructions) when it is called.

Parts of a function:There are four parts of a function

Return TypeName of the functionParametersFunction Body/DefinitionReturn Type:The type of data function returns after performing its functionality.

Any primitive data type can be used as return type. So return type may be int, float, double, char, long etc.

Name of the Function:Name of the function must show what the function is about. For example, if we want to make a function which simply adds some numbers, then the function name will be sum or summation or add just to show that the function simply adds numbers.

Parameters:Data to receive whenever the function called is known as parameters of the function. Parameters are enclosed in the round brackets with there primitive data types.

Function Body:Function body contains all the code to execu…