SlideShare a Scribd company logo
ICT 1405 Programming Methodologies
8. Functions
Function?
● Also known as procedure or subroutine in other programming languages.
● A function is a group of statements that together perform a task.
● A function can be called many times.
● A function is a block of code that only runs when it is called.
Why do we need function?
● Reduce code redundancy.
○ If functionality is performed at multiple places in software, then rather than
writing the same code, again and again, it can create a function and call it
everywhere.
● Make code modular.
○ It becomes really simple to read and use the code if the code is divided into
functions
● Provide abstraction.
○ Can use library functions without knowing about their internal work.
Advantages of Functions
● Easier to Code
○ A lengthy program can be divided into small functions.
○ A function is written for a specific task.
○ A programmer can focus the attention on a specific problem.
● Easier to Modify
○ If there is an error in the program, it is corrected in the corresponding
function.
● Easier to Maintain & Debug
○ Each function contains independent source code.
○ A change in one part of the code does not affect other parts.
○ In case of an error, the infected function is debugged only.
○ The user does not need to examine the whole program.
● Reusability
○ They can be executed many times, can call a function whenever it needs.
○ It can be executed in different parts of the program to display the line
repeatedly.
● Less Programming Time
○ A program may be made up of many functions, which are written as
independent programs.
○ Different programmers can work on different functions simultaneously,
which saves a lot of time in the long run.
Functions
Library AKA Built-in
Pre-defined in C.
The functions which are declared in
the C header files such as printf(),
scanf() etc.
User-defined AKA Tailor-made
Created by the programmer.
Declaration of a function
● Syntax:
return_type function_name (parameter1, parameter2,...)
{
//code to be executed
}
● return_type : Data type specifier of the data returned by the function.
● function_name : The identifier by which it will be possible to call the
function.
● Parameters :
○ Each parameter consists of a data type specifier followed by an
identifier. (for example: int age)
● Allow passing arguments to the function when it is called.
● Different parameters are separated by commas.
● Function's body contains statement/s. It is a block of statements surrounded
by braces { }.
Functions
Built-in User-defined
No return type - No parameters
With return type - no parameter/s.
With parameter/s - no return type.
With parameter/s and return type.
No Parameter/s - No Return Type
Syntax:
void functionName (){
//function implementation
}
Example:
void addition(){
int total = 0;
int x = 10;
int y = 20;
total = x + y;
printf(“Total is : %d” , total);
}
With Return Type - No Parameter
Syntax:
returnType functionName (){
//function implementation
//return statement
}
Example:
int addition(){
int total = 0;
int x = 10;
int y = 20;
total = x + y;
return total;
}
With Parameter/s - No Return Type
Syntax:
void functionName (dataType parameter1, dataType parameter2){
//function implementation
}
Example:
void addition(int x, int y){
int total = 0;
total = x + y;
printf(“Total is : %d” , total);
}
With Parameter/s and Return Type.
Syntax:
returnType functionName (dataType parameter1, dataType parameter2){
//function implementation
//return statement
}
Example:
int addition(int x, int y){
int total = 0;
total = x + y;
return total;
}
Calling the Function
● Calling or invoking the function locates the function in the memory, furnishing it
with arguments and causing it to execute.
● When a function is called then the control passed to the function where it is
actually defined.
● The actually statements are executed and control passed again to the calling
program.
Syntax:
variable= function_name(argument1, argument1, …, argumentN);
Prototyping a Function
● While writing a program, function cannot be used without specifying its type or
without telling the compiler about it.
● Therefore, before calling a function, it must be either declared or defined.
● Thus, declaring a function before calling a function is called function declaration
or prototype which tells the compiler that at some point of the program we will
use the function of the name specified in the prototype.
Syntax:
returnType functionName(dataType, dataType, … );
OR
returnType functionName(dataType parameter1, dataType parameter2, … );
END
Ad

More Related Content

Similar to Programming Methodologies Functions - C Language (20)

Functions and structure in programming c
Functions and structure in programming cFunctions and structure in programming c
Functions and structure in programming c
dalalbhargavi19
 
Basic information of function in cpu
Basic information of function in cpuBasic information of function in cpu
Basic information of function in cpu
Dhaval Jalalpara
 
arrays.ppt
arrays.pptarrays.ppt
arrays.ppt
Bharath904863
 
Funtions of c programming. the functions of c helps to clarify all the tops
Funtions of c programming. the functions of c helps to clarify all the topsFuntions of c programming. the functions of c helps to clarify all the tops
Funtions of c programming. the functions of c helps to clarify all the tops
sameermhr345
 
FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
 FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM) FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
Mansi Tyagi
 
Lecture 11 - Functions
Lecture 11 - FunctionsLecture 11 - Functions
Lecture 11 - Functions
Md. Imran Hossain Showrov
 
Chapter 11 Function
Chapter 11 FunctionChapter 11 Function
Chapter 11 Function
Deepak Singh
 
Chapter 1. Functions in C++.pdf
Chapter 1.  Functions in C++.pdfChapter 1.  Functions in C++.pdf
Chapter 1. Functions in C++.pdf
TeshaleSiyum
 
Chapter_1.__Functions_in_C++[1].pdf
Chapter_1.__Functions_in_C++[1].pdfChapter_1.__Functions_in_C++[1].pdf
Chapter_1.__Functions_in_C++[1].pdf
TeshaleSiyum
 
FUNCTION CPU
FUNCTION CPUFUNCTION CPU
FUNCTION CPU
Krushal Kakadia
 
All chapters C++ - Copy.pdfyttttttttttttttttttttttttttttt
All chapters C++ - Copy.pdfytttttttttttttttttttttttttttttAll chapters C++ - Copy.pdfyttttttttttttttttttttttttttttt
All chapters C++ - Copy.pdfyttttttttttttttttttttttttttttt
jacobdiriba
 
C programming language working with functions 1
C programming language working with functions 1C programming language working with functions 1
C programming language working with functions 1
Jeevan Raj
 
Chapter One Function.pptx
Chapter One Function.pptxChapter One Function.pptx
Chapter One Function.pptx
miki304759
 
Functions in C.pptx
Functions in C.pptxFunctions in C.pptx
Functions in C.pptx
Ashwini Raut
 
c.p function
c.p functionc.p function
c.p function
giri5624
 
Chapter 1 (2) array and structure r.pptx
Chapter 1 (2) array and structure r.pptxChapter 1 (2) array and structure r.pptx
Chapter 1 (2) array and structure r.pptx
abenezertekalign118
 
Unit 3 (1)
Unit 3 (1)Unit 3 (1)
Unit 3 (1)
Sowri Rajan
 
Unit-III.pptx
Unit-III.pptxUnit-III.pptx
Unit-III.pptx
Mehul Desai
 
Functions-Computer programming
Functions-Computer programmingFunctions-Computer programming
Functions-Computer programming
nmahi96
 
Chapter Introduction to Modular Programming.ppt
Chapter Introduction to Modular Programming.pptChapter Introduction to Modular Programming.ppt
Chapter Introduction to Modular Programming.ppt
AmanuelZewdie4
 
Functions and structure in programming c
Functions and structure in programming cFunctions and structure in programming c
Functions and structure in programming c
dalalbhargavi19
 
Basic information of function in cpu
Basic information of function in cpuBasic information of function in cpu
Basic information of function in cpu
Dhaval Jalalpara
 
Funtions of c programming. the functions of c helps to clarify all the tops
Funtions of c programming. the functions of c helps to clarify all the topsFuntions of c programming. the functions of c helps to clarify all the tops
Funtions of c programming. the functions of c helps to clarify all the tops
sameermhr345
 
FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
 FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM) FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
Mansi Tyagi
 
Chapter 11 Function
Chapter 11 FunctionChapter 11 Function
Chapter 11 Function
Deepak Singh
 
Chapter 1. Functions in C++.pdf
Chapter 1.  Functions in C++.pdfChapter 1.  Functions in C++.pdf
Chapter 1. Functions in C++.pdf
TeshaleSiyum
 
Chapter_1.__Functions_in_C++[1].pdf
Chapter_1.__Functions_in_C++[1].pdfChapter_1.__Functions_in_C++[1].pdf
Chapter_1.__Functions_in_C++[1].pdf
TeshaleSiyum
 
All chapters C++ - Copy.pdfyttttttttttttttttttttttttttttt
All chapters C++ - Copy.pdfytttttttttttttttttttttttttttttAll chapters C++ - Copy.pdfyttttttttttttttttttttttttttttt
All chapters C++ - Copy.pdfyttttttttttttttttttttttttttttt
jacobdiriba
 
C programming language working with functions 1
C programming language working with functions 1C programming language working with functions 1
C programming language working with functions 1
Jeevan Raj
 
Chapter One Function.pptx
Chapter One Function.pptxChapter One Function.pptx
Chapter One Function.pptx
miki304759
 
Functions in C.pptx
Functions in C.pptxFunctions in C.pptx
Functions in C.pptx
Ashwini Raut
 
c.p function
c.p functionc.p function
c.p function
giri5624
 
Chapter 1 (2) array and structure r.pptx
Chapter 1 (2) array and structure r.pptxChapter 1 (2) array and structure r.pptx
Chapter 1 (2) array and structure r.pptx
abenezertekalign118
 
Functions-Computer programming
Functions-Computer programmingFunctions-Computer programming
Functions-Computer programming
nmahi96
 
Chapter Introduction to Modular Programming.ppt
Chapter Introduction to Modular Programming.pptChapter Introduction to Modular Programming.ppt
Chapter Introduction to Modular Programming.ppt
AmanuelZewdie4
 

Recently uploaded (20)

How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
Viam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdfViam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdf
camilalamoratta
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Play It Safe: Manage Security Risks - Google Certificate
Play It Safe: Manage Security Risks - Google CertificatePlay It Safe: Manage Security Risks - Google Certificate
Play It Safe: Manage Security Risks - Google Certificate
VICTOR MAESTRE RAMIREZ
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
MINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PRMINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PR
MIND CTI
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
UiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer OpportunitiesUiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer Opportunities
DianaGray10
 
The Changing Compliance Landscape in 2025.pdf
The Changing Compliance Landscape in 2025.pdfThe Changing Compliance Landscape in 2025.pdf
The Changing Compliance Landscape in 2025.pdf
Precisely
 
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent LasterAI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
The Future of Cisco Cloud Security: Innovations and AI Integration
The Future of Cisco Cloud Security: Innovations and AI IntegrationThe Future of Cisco Cloud Security: Innovations and AI Integration
The Future of Cisco Cloud Security: Innovations and AI Integration
Re-solution Data Ltd
 
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
James Anderson
 
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Markus Eisele
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
AsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API DesignAsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API Design
leonid54
 
GyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
GyrusAI - Broadcasting & Streaming Applications Driven by AI and MLGyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
GyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
Gyrus AI
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
Viam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdfViam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdf
camilalamoratta
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Play It Safe: Manage Security Risks - Google Certificate
Play It Safe: Manage Security Risks - Google CertificatePlay It Safe: Manage Security Risks - Google Certificate
Play It Safe: Manage Security Risks - Google Certificate
VICTOR MAESTRE RAMIREZ
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
MINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PRMINDCTI revenue release Quarter 1 2025 PR
MINDCTI revenue release Quarter 1 2025 PR
MIND CTI
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
UiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer OpportunitiesUiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer Opportunities
DianaGray10
 
The Changing Compliance Landscape in 2025.pdf
The Changing Compliance Landscape in 2025.pdfThe Changing Compliance Landscape in 2025.pdf
The Changing Compliance Landscape in 2025.pdf
Precisely
 
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent LasterAI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
The Future of Cisco Cloud Security: Innovations and AI Integration
The Future of Cisco Cloud Security: Innovations and AI IntegrationThe Future of Cisco Cloud Security: Innovations and AI Integration
The Future of Cisco Cloud Security: Innovations and AI Integration
Re-solution Data Ltd
 
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
James Anderson
 
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Markus Eisele
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
AsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API DesignAsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API Design
leonid54
 
GyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
GyrusAI - Broadcasting & Streaming Applications Driven by AI and MLGyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
GyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
Gyrus AI
 
Ad

Programming Methodologies Functions - C Language

  • 1. ICT 1405 Programming Methodologies 8. Functions
  • 2. Function? ● Also known as procedure or subroutine in other programming languages. ● A function is a group of statements that together perform a task. ● A function can be called many times. ● A function is a block of code that only runs when it is called.
  • 3. Why do we need function? ● Reduce code redundancy. ○ If functionality is performed at multiple places in software, then rather than writing the same code, again and again, it can create a function and call it everywhere. ● Make code modular. ○ It becomes really simple to read and use the code if the code is divided into functions ● Provide abstraction. ○ Can use library functions without knowing about their internal work.
  • 4. Advantages of Functions ● Easier to Code ○ A lengthy program can be divided into small functions. ○ A function is written for a specific task. ○ A programmer can focus the attention on a specific problem. ● Easier to Modify ○ If there is an error in the program, it is corrected in the corresponding function.
  • 5. ● Easier to Maintain & Debug ○ Each function contains independent source code. ○ A change in one part of the code does not affect other parts. ○ In case of an error, the infected function is debugged only. ○ The user does not need to examine the whole program. ● Reusability ○ They can be executed many times, can call a function whenever it needs. ○ It can be executed in different parts of the program to display the line repeatedly.
  • 6. ● Less Programming Time ○ A program may be made up of many functions, which are written as independent programs. ○ Different programmers can work on different functions simultaneously, which saves a lot of time in the long run.
  • 7. Functions Library AKA Built-in Pre-defined in C. The functions which are declared in the C header files such as printf(), scanf() etc. User-defined AKA Tailor-made Created by the programmer.
  • 8. Declaration of a function ● Syntax: return_type function_name (parameter1, parameter2,...) { //code to be executed }
  • 9. ● return_type : Data type specifier of the data returned by the function. ● function_name : The identifier by which it will be possible to call the function. ● Parameters : ○ Each parameter consists of a data type specifier followed by an identifier. (for example: int age) ● Allow passing arguments to the function when it is called. ● Different parameters are separated by commas. ● Function's body contains statement/s. It is a block of statements surrounded by braces { }.
  • 10. Functions Built-in User-defined No return type - No parameters With return type - no parameter/s. With parameter/s - no return type. With parameter/s and return type.
  • 11. No Parameter/s - No Return Type Syntax: void functionName (){ //function implementation } Example: void addition(){ int total = 0; int x = 10; int y = 20; total = x + y; printf(“Total is : %d” , total); }
  • 12. With Return Type - No Parameter Syntax: returnType functionName (){ //function implementation //return statement } Example: int addition(){ int total = 0; int x = 10; int y = 20; total = x + y; return total; }
  • 13. With Parameter/s - No Return Type Syntax: void functionName (dataType parameter1, dataType parameter2){ //function implementation } Example: void addition(int x, int y){ int total = 0; total = x + y; printf(“Total is : %d” , total); }
  • 14. With Parameter/s and Return Type. Syntax: returnType functionName (dataType parameter1, dataType parameter2){ //function implementation //return statement } Example: int addition(int x, int y){ int total = 0; total = x + y; return total; }
  • 15. Calling the Function ● Calling or invoking the function locates the function in the memory, furnishing it with arguments and causing it to execute. ● When a function is called then the control passed to the function where it is actually defined. ● The actually statements are executed and control passed again to the calling program. Syntax: variable= function_name(argument1, argument1, …, argumentN);
  • 16. Prototyping a Function ● While writing a program, function cannot be used without specifying its type or without telling the compiler about it. ● Therefore, before calling a function, it must be either declared or defined. ● Thus, declaring a function before calling a function is called function declaration or prototype which tells the compiler that at some point of the program we will use the function of the name specified in the prototype. Syntax: returnType functionName(dataType, dataType, … ); OR returnType functionName(dataType parameter1, dataType parameter2, … );
  • 17. END