Call by reference:
-Here call by reference means we call a function and pass variable reference instead of variable value.
-Pointer are used in such kind of calling.
program-
#include< stdio.h>
int func(int *a, int *b)
{
int t;
t=*a;
*a=*b;
*b=t;
}
int main() {
int i,j;
printf("Enter two numbers\n");
scanf("%d%d",&i,&j);
printf("Before function calling\");
printf("%d %d",i,j);
func(&i,&j);
printf("After function calling");
printf("%d %d",i,j);
}
Enter two number
3 4
Before function calling
3 4
After function calling
4 3