What is Functions?
A Number of Statements Grouped into a Single Logical Unit is referred to as a ‘Function‘ which is made to Complete a Specific Task. A Program can be made of many functions but ‘main‘ is the ‘Function‘ whose statements are executed ‘First‘. Functions are mainly classified in two types:
- User-Defined Function
- Inbuilt Function
Types Of Functions:
1.User-Defined Function:
‘C‘ allows user to define functions according to your need. Each ‘function‘ has Call and Body. These ‘Functions‘ are known as User-Defined Function.
Suppose, you need to create a Circle and Color it depending upon the Radius and Color. You can create two ‘Functions‘ to solve this Problem.
- createCircle() function
- Color() function
2.In-built Function:
The In-built Functions also called as predefined functions, because information regarding these ‘Functions‘ is already defined in Header Files.
Example of In-built Functions:
printf(), scanf(), getch(), gets(), puts(), sin(), cos(), pow(), getche(). are examples of In-built Functions. Each Function Contain pair of round brackets().