SlideShare a Scribd company logo
1 of 17
FUNCTION
1
FUNCTION
What is function?
How the function works?
What is the advantage of using function?
How to call C functions in a program?
And classification of function.
2
FUNCTION
A function is a group of statements that together
perform a task. Every C program has at least one
function, which is main ()
3
ADVANTAGE OF USING FUNCTION
 It is much easier to write a structured program where a large program can be
divided into a smaller, simpler task.
 Allowing the code to be called many times
 Easier to read and update
 It is easier to debug a structured program where there error is easy to find and
fix
4
CLASSIFICATION OF
FUNCTION
There are two types of function:-
User defined function [ main () ]
Library function [ printf(), scanf(), getchar(), sqrt() ]
5
USER DEFINED FUNCTION
return_type function_name (parameters)
{
function_boady
return value
}
6
7
return_type: When
function finished its
work then what
kind of data it will
return
function_name:
Write a meaningful
name.
Parameters: For
function, here will
be enough data to
work properly.
function_body:
How the function will
work and what kind
of work it will do.
return_value: what
kind of data it will
return
EXAMPLE OF USER DEFINED
FUNCTION
#include<stdio.h>
int add(double num1, double num2)
{
double sum = num1+num2;
return sum;
}
int main ()
{
double a, b, c;
a = b = 2.5;
c = add(a, b);
printf(“%lfn”, c);
return 0 ;
} 8
int
called
return_type
add
function
name
num1, num2
Parameteres
sum =
num1+num2
sum
return_value
9
USER DEFINED FUNCTION
#include<stdio.h>
int main ()
{
double a, b, c;
a = b = 2.5;
c = add(a, b);
printf(“%lfn”, c);
return 0 ;
}
int add(double num1, double num2)
{
double sum = num1+num2;
return sum;
} 10
If we now write add function after main function then
what will happen. If we write add function after main
function then program will not be executed. Compiler
will show error “add was not declared in this scope.” So,
what can we do now to execute this program.
Note: Don`t put this box in slide. It`s only for your
understanding
USER DEFINED FUNCTION
#include<stdio.h>
int add(double num1, double num2) ;
int main ()
{
double a, b, c;
a = b = 2.5;
c = add(a, b);
printf(“%lfn”, c);
return 0 ;
}
int add(double num1, double num2)
{
double sum = num1+num2;
return sum;
}
11
We can write a line before the main function.
The line is int add (double num1, double
num2); Now the program will run. This line is
called prototype. Here it is the prototype of
the add function.
Note: Don`t put this box in slide. It`s only for
your understanding
USER DEFINED FUNCTION
#include<stdio.h>
int test_function(int x)
{
int y = x;
x = 2 * y;
return (x*y);
}
int main()
{
int x =10, y = 20, z = 30;
z = test_function(x);
printf("%d %d %dn“, x, y, z);
return 0;
}
12
Can you tell me what is the output of this program? If I tell
you the output is 20 10 200 (that`s mean x = 20, y = 10, z =
200). Do you agree with me?
Because we change the value of x and y in test_function.
First, we send the value of x = 10 like parameter then we
set up this value in y that`s mean y = 10. After that we set
the value of x in 2*y that`s mean 20. Then we return x*y (
that`s value is 20*10 = 200). So, we get the value of z is
200.
Note: Don`t put this box in slide. It`s only for your
understanding
USER DEFINED FUNCTION
13
But when we run
this program, the
output is 10 20 200
(x = 10 y = 20 z =
200)
Note: Don`t put
this box in slide. It`s
only for your
understanding
• Now we can ask what is the reason of this kind of output, there is no
confusion about the value of z. There is confusion about the value of x
and y. We change the value of x and y in test_function but it does not
effect in the value of x and y in main function. Because the value of
every function is different. It`s call local variable. We have printed the
value of x and y of main function but we do not print the value of x and
y of test_function. That`s mean one function`s variable does not exist
in another function. If we want to exist that variable in every function
of whole program, we can declare that variable as a global variable. We
declare the global variable before write the prototype.
• Note: Don`t put this slide in slide. This text only for your
understanding
14
USER DEFINED FUNCTION
#include<stdio.h>
double pi = 3.14;
void my_function()
{
pi = 3.1416; /*Here we change the value of pi */
return; /* If the return type of function is void then this return not necessary */
}
int main()
{
printf(“%lfn”,pi); /* Here the value of pi is 3.14 */
my_function();
printf(“%lfn”,pi); /* Here the value of pi is 3.1416 because we change the value
in my_function */
return 0;
} 15
Here pi = 3.14 is
the global
variable. If we
declared a
variable in
my_function
(double pi) that’s
called a local
variable and value
of global variable
pi did not change
Note: Don`t put
this box in slide.
It`s only for your
understanding
USER DEFINED FUNCTION
16
17
• Studying: B.Sc. In Computer Science
and Engineering
• Institute: Daffodil International
University
• FB:
www.facebook.com/touhidulshaon
• Note: This slide was created by Md.
Touhidul Islam Shawan. Here in this slide I
have written about some basic points of
function of c program and how the
function works.

More Related Content

What's hot (20)

C function
C functionC function
C function
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Function Pointer
Function PointerFunction Pointer
Function Pointer
 
Inline function
Inline functionInline function
Inline function
 
Function in c
Function in cFunction in c
Function in c
 
Pointers in c++
Pointers in c++Pointers in c++
Pointers in c++
 
Type casting in c programming
Type casting in c programmingType casting in c programming
Type casting in c programming
 
Conditional statement c++
Conditional statement c++Conditional statement c++
Conditional statement c++
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructors
 
Functions in c language
Functions in c language Functions in c language
Functions in c language
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Functions in c++
Functions in c++Functions in c++
Functions in c++
 
Function overloading(c++)
Function overloading(c++)Function overloading(c++)
Function overloading(c++)
 
Ansi c
Ansi cAnsi c
Ansi c
 
Functions in C
Functions in CFunctions in C
Functions in C
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Function lecture
Function lectureFunction lecture
Function lecture
 
Function overloading ppt
Function overloading pptFunction overloading ppt
Function overloading ppt
 

Similar to C function presentation

Similar to C function presentation (20)

Function
FunctionFunction
Function
 
Presentation 2 (1).pdf
Presentation 2 (1).pdfPresentation 2 (1).pdf
Presentation 2 (1).pdf
 
Functions-Computer programming
Functions-Computer programmingFunctions-Computer programming
Functions-Computer programming
 
Functions
Functions Functions
Functions
 
Unit-III.pptx
Unit-III.pptxUnit-III.pptx
Unit-III.pptx
 
unit3 part2 pcds function notes.pdf
unit3 part2 pcds function notes.pdfunit3 part2 pcds function notes.pdf
unit3 part2 pcds function notes.pdf
 
CH.4FUNCTIONS IN C_FYBSC(CS).pptx
CH.4FUNCTIONS IN C_FYBSC(CS).pptxCH.4FUNCTIONS IN C_FYBSC(CS).pptx
CH.4FUNCTIONS IN C_FYBSC(CS).pptx
 
Lecture 1_Functions in C.pptx
Lecture 1_Functions in C.pptxLecture 1_Functions in C.pptx
Lecture 1_Functions in C.pptx
 
Functionincprogram
FunctionincprogramFunctionincprogram
Functionincprogram
 
Chapter 1.ppt
Chapter 1.pptChapter 1.ppt
Chapter 1.ppt
 
c.p function
c.p functionc.p function
c.p function
 
Unit 3 (1)
Unit 3 (1)Unit 3 (1)
Unit 3 (1)
 
[ITP - Lecture 12] Functions in C/C++
[ITP - Lecture 12] Functions in C/C++[ITP - Lecture 12] Functions in C/C++
[ITP - Lecture 12] Functions in C/C++
 
cp Module4(1)
cp Module4(1)cp Module4(1)
cp Module4(1)
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
C functions list
C functions listC functions list
C functions list
 
Functions assignment
Functions assignmentFunctions assignment
Functions assignment
 
Function
Function Function
Function
 
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
 
Presentation 2.pptx
Presentation 2.pptxPresentation 2.pptx
Presentation 2.pptx
 

More from Touhidul Shawan

LINEAR DIFFERENTIAL EQUATION & BERNOULLI`S EQUATION
LINEAR DIFFERENTIAL EQUATION & BERNOULLI`S EQUATIONLINEAR DIFFERENTIAL EQUATION & BERNOULLI`S EQUATION
LINEAR DIFFERENTIAL EQUATION & BERNOULLI`S EQUATIONTouhidul Shawan
 
Propositional logic by shawan
Propositional logic by shawanPropositional logic by shawan
Propositional logic by shawanTouhidul Shawan
 
Atomic model and nuclear reaction
Atomic model and nuclear reactionAtomic model and nuclear reaction
Atomic model and nuclear reactionTouhidul Shawan
 
Math presentation on domain and range
Math presentation on domain and rangeMath presentation on domain and range
Math presentation on domain and rangeTouhidul Shawan
 
Presentation on lights [ physics ]
Presentation on lights [ physics ]Presentation on lights [ physics ]
Presentation on lights [ physics ]Touhidul Shawan
 

More from Touhidul Shawan (6)

Memory management
Memory managementMemory management
Memory management
 
LINEAR DIFFERENTIAL EQUATION & BERNOULLI`S EQUATION
LINEAR DIFFERENTIAL EQUATION & BERNOULLI`S EQUATIONLINEAR DIFFERENTIAL EQUATION & BERNOULLI`S EQUATION
LINEAR DIFFERENTIAL EQUATION & BERNOULLI`S EQUATION
 
Propositional logic by shawan
Propositional logic by shawanPropositional logic by shawan
Propositional logic by shawan
 
Atomic model and nuclear reaction
Atomic model and nuclear reactionAtomic model and nuclear reaction
Atomic model and nuclear reaction
 
Math presentation on domain and range
Math presentation on domain and rangeMath presentation on domain and range
Math presentation on domain and range
 
Presentation on lights [ physics ]
Presentation on lights [ physics ]Presentation on lights [ physics ]
Presentation on lights [ physics ]
 

Recently uploaded

Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 

Recently uploaded (20)

Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 

C function presentation

  • 2. FUNCTION What is function? How the function works? What is the advantage of using function? How to call C functions in a program? And classification of function. 2
  • 3. FUNCTION A function is a group of statements that together perform a task. Every C program has at least one function, which is main () 3
  • 4. ADVANTAGE OF USING FUNCTION  It is much easier to write a structured program where a large program can be divided into a smaller, simpler task.  Allowing the code to be called many times  Easier to read and update  It is easier to debug a structured program where there error is easy to find and fix 4
  • 5. CLASSIFICATION OF FUNCTION There are two types of function:- User defined function [ main () ] Library function [ printf(), scanf(), getchar(), sqrt() ] 5
  • 6. USER DEFINED FUNCTION return_type function_name (parameters) { function_boady return value } 6
  • 7. 7 return_type: When function finished its work then what kind of data it will return function_name: Write a meaningful name. Parameters: For function, here will be enough data to work properly. function_body: How the function will work and what kind of work it will do. return_value: what kind of data it will return
  • 8. EXAMPLE OF USER DEFINED FUNCTION #include<stdio.h> int add(double num1, double num2) { double sum = num1+num2; return sum; } int main () { double a, b, c; a = b = 2.5; c = add(a, b); printf(“%lfn”, c); return 0 ; } 8
  • 10. USER DEFINED FUNCTION #include<stdio.h> int main () { double a, b, c; a = b = 2.5; c = add(a, b); printf(“%lfn”, c); return 0 ; } int add(double num1, double num2) { double sum = num1+num2; return sum; } 10 If we now write add function after main function then what will happen. If we write add function after main function then program will not be executed. Compiler will show error “add was not declared in this scope.” So, what can we do now to execute this program. Note: Don`t put this box in slide. It`s only for your understanding
  • 11. USER DEFINED FUNCTION #include<stdio.h> int add(double num1, double num2) ; int main () { double a, b, c; a = b = 2.5; c = add(a, b); printf(“%lfn”, c); return 0 ; } int add(double num1, double num2) { double sum = num1+num2; return sum; } 11 We can write a line before the main function. The line is int add (double num1, double num2); Now the program will run. This line is called prototype. Here it is the prototype of the add function. Note: Don`t put this box in slide. It`s only for your understanding
  • 12. USER DEFINED FUNCTION #include<stdio.h> int test_function(int x) { int y = x; x = 2 * y; return (x*y); } int main() { int x =10, y = 20, z = 30; z = test_function(x); printf("%d %d %dn“, x, y, z); return 0; } 12 Can you tell me what is the output of this program? If I tell you the output is 20 10 200 (that`s mean x = 20, y = 10, z = 200). Do you agree with me? Because we change the value of x and y in test_function. First, we send the value of x = 10 like parameter then we set up this value in y that`s mean y = 10. After that we set the value of x in 2*y that`s mean 20. Then we return x*y ( that`s value is 20*10 = 200). So, we get the value of z is 200. Note: Don`t put this box in slide. It`s only for your understanding
  • 13. USER DEFINED FUNCTION 13 But when we run this program, the output is 10 20 200 (x = 10 y = 20 z = 200) Note: Don`t put this box in slide. It`s only for your understanding
  • 14. • Now we can ask what is the reason of this kind of output, there is no confusion about the value of z. There is confusion about the value of x and y. We change the value of x and y in test_function but it does not effect in the value of x and y in main function. Because the value of every function is different. It`s call local variable. We have printed the value of x and y of main function but we do not print the value of x and y of test_function. That`s mean one function`s variable does not exist in another function. If we want to exist that variable in every function of whole program, we can declare that variable as a global variable. We declare the global variable before write the prototype. • Note: Don`t put this slide in slide. This text only for your understanding 14
  • 15. USER DEFINED FUNCTION #include<stdio.h> double pi = 3.14; void my_function() { pi = 3.1416; /*Here we change the value of pi */ return; /* If the return type of function is void then this return not necessary */ } int main() { printf(“%lfn”,pi); /* Here the value of pi is 3.14 */ my_function(); printf(“%lfn”,pi); /* Here the value of pi is 3.1416 because we change the value in my_function */ return 0; } 15 Here pi = 3.14 is the global variable. If we declared a variable in my_function (double pi) that’s called a local variable and value of global variable pi did not change Note: Don`t put this box in slide. It`s only for your understanding
  • 17. 17 • Studying: B.Sc. In Computer Science and Engineering • Institute: Daffodil International University • FB: www.facebook.com/touhidulshaon • Note: This slide was created by Md. Touhidul Islam Shawan. Here in this slide I have written about some basic points of function of c program and how the function works.