A function is a subroutine that may include one or more statements to perform a specific task.
To write a 'C' program, we first create functions and then put them together.
'C' function can be classified into two categories namely library functions and user defined functions main() is an example of user defined functions and scanf() and printf() belongs to category of library functions. Same other examples of library functions are sqrt(), cos(), strcpy(), strcmp() etc. The main difference between library functions and user defined functions is that library functions are not required to be written by user whereas a user defined function has to be developed by the user at the time of writing a program.
Library functions are available to all users but user defined function must be defined and used in only a particular program and it is not accessible by all. Library functions are available in compiled object code form and cannot be viewed by user.
To write a 'C' program, we first create functions and then put them together.
'C' function can be classified into two categories namely library functions and user defined functions main() is an example of user defined functions and scanf() and printf() belongs to category of library functions. Same other examples of library functions are sqrt(), cos(), strcpy(), strcmp() etc. The main difference between library functions and user defined functions is that library functions are not required to be written by user whereas a user defined function has to be developed by the user at the time of writing a program.
Library functions are available to all users but user defined function must be defined and used in only a particular program and it is not accessible by all. Library functions are available in compiled object code form and cannot be viewed by user.
No comments:
Post a Comment