FUNCTIONS In C-Programming
FUNCTIONS
A function in C is a block of code that performs a specific task. Instead of
writing the same code multiple times, a function allows code reuse and
improves readability.
SYNTAX OF A FUNCTION
• return_type The data type of the value the function returns. Use void if the function
→
does not return anything.
• function_name The identifier used to call the function.
→
• parameters (arguments) Values passed to the function (optional).
→
• function body The set of instructions the function executes.
→
• return statement Returns a value (optional, required if return type is not void).
→
FUNCTIONS
A function in C is a block of code that performs a specific task. Instead of
writing the same code multiple times, a function allows code reuse and
improves readability.
TYPES OF FUNCTIONS
In C, functions are essential for structuring programs. They are
categorized into:
• System-defined (predefined) functions
• User-defined functions
SYSTEM-DEFINED FUNCTIONS
System-defined functions are built-in functions provided by C's
standard libraries. They perform common tasks such as input/output
operations, mathematical calculations, string handling, etc.
These functions require the inclusion of the relevant header file before use.
EXAMPLE

Functions used in C- Programming and its types

  • 1.
  • 2.
    FUNCTIONS A function inC is a block of code that performs a specific task. Instead of writing the same code multiple times, a function allows code reuse and improves readability.
  • 3.
    SYNTAX OF AFUNCTION • return_type The data type of the value the function returns. Use void if the function → does not return anything. • function_name The identifier used to call the function. → • parameters (arguments) Values passed to the function (optional). → • function body The set of instructions the function executes. → • return statement Returns a value (optional, required if return type is not void). →
  • 4.
    FUNCTIONS A function inC is a block of code that performs a specific task. Instead of writing the same code multiple times, a function allows code reuse and improves readability.
  • 5.
    TYPES OF FUNCTIONS InC, functions are essential for structuring programs. They are categorized into: • System-defined (predefined) functions • User-defined functions
  • 6.
    SYSTEM-DEFINED FUNCTIONS System-defined functionsare built-in functions provided by C's standard libraries. They perform common tasks such as input/output operations, mathematical calculations, string handling, etc. These functions require the inclusion of the relevant header file before use.
  • 7.