Login Register Appointment

Functions – Definition, Call, Types (Library & User-Defined)

Lesson 9/27 | Study Time: 60 Min

What You Will Learn in This Live Session

1️⃣ Introduction to Functions

  • What are functions, and why do we use them?
  • Benefits of using functions in programming

2️⃣ Function Definition and Function Call

✔ Function Definition: Writing the function body
✔ Function Call: Invoking a function to execute
✔ Function Declaration (Prototype): Informing the compiler about a function before use

3️⃣ Types of Functions

✔ Library Functions (Predefined Functions)

  • Functions from standard libraries like <stdio.h>, <math.h>, <string.h>, etc.
  • Example: printf(), scanf(), strlen(), sqrt(), pow(), etc.

✔ User-Defined Functions

  • Creating custom functions for specific tasks
  • Example: A function to calculate the sum of two numbers


4️⃣ Function Parameters and Return Values

✔ Function without Parameters & without Return Value
✔ Function with Parameters & without Return Value
✔ Function without Parameters & with Return Value
✔ Function with Parameters & with Return Value

5️⃣ Function Calling Mechanisms

✔ Call by Value – Passing a copy of arguments
✔ Call by Reference – Passing address of arguments for modification