0% found this document useful (0 votes)
23 views2 pages

Functions in C Language: Library Functions Are Those Functions Which Are Already Defined in C Library

Functions in C language allow programmers to reuse blocks of code by defining groups of statements that can be called whenever needed. There are two types of functions: library functions that are predefined in the C standard library and user-defined functions that are created by the programmer for code reusability and to save time and space. Using functions provides modularity, code reuse, easier debugging and editing of large programs, and improved readability.

Uploaded by

mynenianupama
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

Functions in C Language: Library Functions Are Those Functions Which Are Already Defined in C Library

Functions in C language allow programmers to reuse blocks of code by defining groups of statements that can be called whenever needed. There are two types of functions: library functions that are predefined in the C standard library and user-defined functions that are created by the programmer for code reusability and to save time and space. Using functions provides modularity, code reuse, easier debugging and editing of large programs, and improved readability.

Uploaded by

mynenianupama
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Functions in C language

A function is a block of code that performs a particular task.


There are many situations where we might need to write same line of code for more than
once in a program. This may lead to unnecessary repetition of code, bugs and even
becomes boring for the programmer. So, C language provides an approach in which you
can declare and define a group of statements once in the form of a function and it can be
called and used whenever required.
These functions defined by the user are also know as User-defined Functions
C functions can be classified into two categories,

1. Library functions
2. User-defined functions

Library functions are those functions which are already defined in C library,
example printf(), scanf(), strcat() etc. You just need to include appropriate header files
to use these functions. These are already declared and defined in C libraries.
A User-defined functions on the other hand, are those functions which are defined by the
user at the time of writing program. These functions are made for code reusability and for
saving time and space.
Benefits of Using Functions

1. It provides modularity to your program's structure.


2. It makes your code reusable. You just have to call the function by its name to use it,
wherever required.
3. In case of large programs with thousands of code lines, debugging and editing becomes
easier if you use functions.
4. It makes the program more readable and easy to understand.

You might also like