what is the difference between library function and user-defined function?

Library FunctionUser defined function
1. library functions are predefined functions in the C compiler.1. user-defined is a function defined by the user to perform specific tasks.
2. This function required a header file.2. This function required a prototype to use it.
3. No need to declare and define the function to use library function.3. This function required function declaration and definition of function before used it.
4. This function saves our time ad easy to use. 4. This takes more time than the library function.
5. Example are : strlen();, strcat();, sqrt();, strcmp();, etc.5. Example are sum(int a, int b);, prime(int a); etc.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *