S.N | Library function | user-defined function |
1. | A library function is a predefined function in a header file or preprocessor directive. | A user-defined function is not a predefined function, it is defined by the programmer according to the need. |
2. | The programmer can simply use this function by including the respective header file. | the programmer has to declare, define, and use this function by themself. |
3. | The program using library function will be usually short as the programmer doesn't have to define the function. | The program using the user-defined function well be usually lengthy as the programmer has to define the function. |
4. | Program development time will be faster. | program development time will be usually slower. |
5. | This program using library function will be usually simple. | This program using library function will be usually complex. |
6. | This function requires a header file to use it. | This function requires a function prototype to use it. |
7. |
example: print(), scanf(), getch(), Strlent(), pow() |
example: area_circle(), factorial(), swap_number() |