Pass by value (OR) Call by value : When a function is called with actual parameters, the values of actual
parameters are copied into formal parameters. If the values of the formal parametes changes in the function, the values of the actual parameters are not changed. This way of passing parameters is called pass by value or call
by value.
Ex :
#include<stdio.h>
#include<conio.h>
void swap(int a,int j);
void main()
{
int i,j;
printf("Enter i and j values:");
scanf("%d%d",&i,&j);
printf("Before swapping:%d%d\n",i,j);
swap(i,j);
printf("After swapping:%d%d\n",i,j);
getch();
}
void swap(int a,int b)
{
int temp;
temp=a;
a=b;
b=temp;
}