Call by value

Estudies4you
Call by value
Call by value is copying the value of a variable in another variable. So any change made in the copy will not affect the original location.
int a=10;
void fun(int a)
fun(a);
{
Definition;
}
Here, fun(a) is a call by value.
Note: Any change, which is done within the function is local and will not change the outside function.
Example:
#include<stdio.h>
void main()
{
int a=10; //a is read as 10
printf(“%d”,a);
fun(a);
printf(“%d”,a); //a is read as 10
}
void fun(int x) //x is read as 10
printf(“%d”,x);
x++;
printf(“%d”,x); //x is read as 11
}

OUTPUT
10 10 11 10
call by value,call by reference,what is call by value,define call by value in functions,functions in c language,jntuh cse study material,jntu study material for first year,jntuh b.tech r18 cse study material, jntuh 3 2 cse study materials,jntuh 4-2 cse study materials,jntuh 2-2 cse study materials, jntuh 2-1 cse study materials,jntuh 3-1 cse study materials,jntuh 4-1 cse study materials, jntuh b.tech r16 syllabus,jntuh b.tech r18 syllabus,jntuh b.tech r16 3-2 syllabus,jntuh b.tech r16 2-2 syllabus, r16 jntu lecture notes,r18 jntu lecture notes, jntuh 2-1 lecture notes,jntuh 3-1 lecture notes,jntuh 4-1 lecture notes, jntuh 2-2 lecture notes,jntuh 3-2 lecture notes,jntuh 4-2 lecture notes, jntuh computer programming in c lecture notes, jntuh r16 computer programming in c notes pdf, jntuh r18 computer programming in c notes pdf,jntuh r18 syllabus pdf,estudies4you,c language lecture notes jntuh,r18 c language lecture notes,
To Top