0% found this document useful (0 votes)
5 views3 pages

Call by Value

The document outlines a C program that demonstrates the concepts of Call by Value and Call by Reference. It includes an algorithm detailing the steps to define functions that modify variables and print their values before and after the function calls. The learning outcomes emphasize understanding variable passing methods, pointers, and function definitions in C.

Uploaded by

patience.g2006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

Call by Value

The document outlines a C program that demonstrates the concepts of Call by Value and Call by Reference. It includes an algorithm detailing the steps to define functions that modify variables and print their values before and after the function calls. The learning outcomes emphasize understanding variable passing methods, pointers, and function definitions in C.

Uploaded by

patience.g2006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

‭SALONI SHARMA (01317749524)‬

‭QUES :‬‭Write a C program to understand the concept‬‭of 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‬

‭updated value of *b inside the function‬

‭4.‬ ‭Declare two integer variables x and y , intialize both to 6‬

‭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‬

‭the function call‬

‭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‬

‭modification of the original variables‬

‭3.‬ ‭Gain basic knowledge about pointers about pointers and how they are used to‬

‭pass addresses of varibles .‬

‭4.‬ ‭Learn how to define and call fuctions in c including parameter mechanism‬

You might also like