Function used in C programming
Types of Function
User defined function
Size: 275.42 KB
Language: en
Added: Mar 12, 2025
Slides: 7 pages
Slide Content
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.