SlideShare a Scribd company logo
2
Most read
Welcome to Our
Presentation
CALL BY VALUE AND CALL
BY REFERENCE
SUHANI VERMA
PALAK PARMAR
Member Name
Member Name Member Name
YATRI SHELDIYA
Call by Value
Introduction to Call Methods
Call by
Reference
Arguments
are passed by
copying their
values.
Arguments
are passed by
referencing
their memory
addresses.
Changes inside
the function do
not affect the
caller.
Usage
A copy of the
actual
parameter's value
is passed.
Definition Effect on
Parameters Commonly used
in C
programming for
simple data
types.
Overview of Call by Value
3
1 2
Useful for reflecting changes
back to the caller.
Use Case
Passes the address of the
actual parameter.
Overview of Call by Reference
Definition
Allows direct modification of
the original variable.
Modification
CALL BY VALUE AND CALL BY REFRENCE IN C #
Original Value
Modified?
Call by value Call by refrence
NO YES
Feature Call by Value Call by Reference
Data Passing Copies the value Passes the address
Original Data Unchanged Can be modified
Memory Usage More memory for copies Less memory usage
Performance Slower for large data types Faster for large data types
Use Case Safe for small data types Useful for large data types
Key Differences
Example of Call by Value
#include <stdio.h>
void modifyValue(int num)
{
num += 10; // Modify the value
printf("Inside function: %dn", num);
}
int main()
{
int originalValue = 5;
printf("Before function call: %dn", originalValue);
modifyValue(originalValue); // Call the function
printf("After function call: %dn", originalValue);
return 0;
}
OUTPUT
1 3
Example of Call by Reference
.
#include <stdio.h>
void addTen(int *num)
{
*num = *num + 10; // Modify the value at the address passed
}
int main()
{
int num = 5;
printf("Before function call: %dn", num);
addTen(&num); // Pass the address of num
printf("After function call: %dn", num); // num is modified
return 0;
}
OUTPUT
Essential for effective C
programming.
Each has its own use cases.
Conclusion
Knowing when to use each
method.
Advantages of Each
Method
Enhancing Coding Skills
Importance of
Understanding
We value your time and attention.
We hope this article aids your
understanding.
Appreciation
Learning Journey
Thank You

More Related Content

PPTX
2-Concept of Pointers in c programming.pptx
PDF
CSE101-Lec#14 [function call].pdf
PPTX
Presentation.pptx
PDF
Functions_C++ power point presentation s
PPTX
Classes function overloading
PPTX
Pointers lesson 5 (double pointer, call by value, call_by_reference)
PPTX
Call by value
PPTX
practices of C programming function concepts
2-Concept of Pointers in c programming.pptx
CSE101-Lec#14 [function call].pdf
Presentation.pptx
Functions_C++ power point presentation s
Classes function overloading
Pointers lesson 5 (double pointer, call by value, call_by_reference)
Call by value
practices of C programming function concepts

Similar to Call by value V/S Call by reference with example (20)

PPTX
Call by value
DOCX
PPS 6.6.FUNCTION INTRODUCTION & WRITING FUNCTIONS, SCOPE OF VARIABLES FUNCTIONS
PPTX
Types of function call
PPTX
Call by value or call by reference in C++
PDF
Programming in C Functions PPT Presentation.pdf
PPTX
chapter-7 slide.pptx
PDF
USER DEFINED FUNCTIONS IN C.pdf
PDF
VIT351 Software Development VI Unit1
PPTX
FUNCTIONS1.pptx
PPTX
3 Function & Storage Class.pptx
PDF
Modular Programming in C
PPT
computer notes - Data Structures - 17
PPTX
Functions in C
PPTX
Function (rule in programming)
PPTX
C function
PPTX
Parameter passing to_functions_in_c
PPTX
Function in C program
PPTX
Call by value and call by reference in java
PPTX
Presentation on function
PPTX
UNIT3.pptx
Call by value
PPS 6.6.FUNCTION INTRODUCTION & WRITING FUNCTIONS, SCOPE OF VARIABLES FUNCTIONS
Types of function call
Call by value or call by reference in C++
Programming in C Functions PPT Presentation.pdf
chapter-7 slide.pptx
USER DEFINED FUNCTIONS IN C.pdf
VIT351 Software Development VI Unit1
FUNCTIONS1.pptx
3 Function & Storage Class.pptx
Modular Programming in C
computer notes - Data Structures - 17
Functions in C
Function (rule in programming)
C function
Parameter passing to_functions_in_c
Function in C program
Call by value and call by reference in java
Presentation on function
UNIT3.pptx
Ad

Recently uploaded (20)

PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
Cell Types and Its function , kingdom of life
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Computing-Curriculum for Schools in Ghana
PDF
01-Introduction-to-Information-Management.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
RMMM.pdf make it easy to upload and study
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Cell Types and Its function , kingdom of life
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Abdominal Access Techniques with Prof. Dr. R K Mishra
human mycosis Human fungal infections are called human mycosis..pptx
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Computing-Curriculum for Schools in Ghana
01-Introduction-to-Information-Management.pdf
Complications of Minimal Access Surgery at WLH
Module 4: Burden of Disease Tutorial Slides S2 2025
RMMM.pdf make it easy to upload and study
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
202450812 BayCHI UCSC-SV 20250812 v17.pptx
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
O5-L3 Freight Transport Ops (International) V1.pdf
Ad

Call by value V/S Call by reference with example

  • 2. CALL BY VALUE AND CALL BY REFERENCE SUHANI VERMA PALAK PARMAR Member Name Member Name Member Name YATRI SHELDIYA
  • 3. Call by Value Introduction to Call Methods Call by Reference Arguments are passed by copying their values. Arguments are passed by referencing their memory addresses.
  • 4. Changes inside the function do not affect the caller. Usage A copy of the actual parameter's value is passed. Definition Effect on Parameters Commonly used in C programming for simple data types. Overview of Call by Value
  • 5. 3 1 2 Useful for reflecting changes back to the caller. Use Case Passes the address of the actual parameter. Overview of Call by Reference Definition Allows direct modification of the original variable. Modification
  • 6. CALL BY VALUE AND CALL BY REFRENCE IN C # Original Value Modified? Call by value Call by refrence NO YES
  • 7. Feature Call by Value Call by Reference Data Passing Copies the value Passes the address Original Data Unchanged Can be modified Memory Usage More memory for copies Less memory usage Performance Slower for large data types Faster for large data types Use Case Safe for small data types Useful for large data types Key Differences
  • 8. Example of Call by Value #include <stdio.h> void modifyValue(int num) { num += 10; // Modify the value printf("Inside function: %dn", num); } int main() { int originalValue = 5; printf("Before function call: %dn", originalValue); modifyValue(originalValue); // Call the function printf("After function call: %dn", originalValue); return 0; } OUTPUT
  • 9. 1 3 Example of Call by Reference . #include <stdio.h> void addTen(int *num) { *num = *num + 10; // Modify the value at the address passed } int main() { int num = 5; printf("Before function call: %dn", num); addTen(&num); // Pass the address of num printf("After function call: %dn", num); // num is modified return 0; } OUTPUT
  • 10. Essential for effective C programming. Each has its own use cases. Conclusion Knowing when to use each method. Advantages of Each Method Enhancing Coding Skills Importance of Understanding
  • 11. We value your time and attention. We hope this article aids your understanding. Appreciation Learning Journey Thank You