Call by Reference example code written in C Programming. The code explains how to pass address as arguments from calling function to called functions.
#include<stdio.h> int main() { int a,b,c; clrscr(); printf("Enter Two Values: "); scanf("%d %d",&a,&b); c=add(&a,&b); printf("The Sum is: %d",c); return 0; } add(int *x,int *y) { int z; z=*x+*y; return(z); }
OUTPUT:
Enter Two Values: 30 20 The Sum is: 50