
Functions 331
p rin tf ("Sum ■ %d,r, * s ) ;
return 0;
}
*sum( )
I
int x,y,z,k;
printf("\n Enter three values
scanf ("% d %d %d”,&x,&y&z);
k & y + z ;
return (&k);
}
Explanation The function sum () is declared as a pointer function, that is, the function declared
as a pointer always returns a reference. The reference returned by the function sum () is assigned
to pointer *s. The pointer *s prints the sum.
10.6 CALL BY VALUE AND REFERENCE
There are two ways by which we can pass arguments to the function.
1) Call by value
2) Call by reference
1) Call by value: In this type values of the actual argument are passed to the formal argument
and ope ...