Call by Value
Call by Value
QUES :Write a C program to understand the conceptof Call by Value and Call by Reference.
ALGORITHM:
1. Start
2. Define function callByValue(int a): add 10 to variable a and print the value of a inside the
function
3. Define function callByReference(int b): add 10 to the value pointed by b and print the
5. Print value of x before the function call , call callByValue(x) , print value of x after the
function call
6. Print value of y before the function call , call callByReference(&y), print value of y after
7. End
FLOWCHART:
SALONI SHARMA (01317749524)
SOURCE CODE:
OUTPUT:
SALONI SHARMA (01317749524)
LEARNING OUTCOMES:
1. Understanding call by value : will understand how passing variables by value
works in c
2. Understanding call by reference: learn how passing variables by reference allows
3. Gain basic knowledge about pointers about pointers and how they are used to
4. Learn how to define and call fuctions in c including parameter mechanism