main( )
{
int r ;
float a, peri ;
printf ( "\nEnter radius of a circle " ) ;
scanf ( "%d", &r ) ;
aperi ( r, &a, &peri ) ;
printf ( "area = %f", a ) ;
printf ( "\nperimeter = %f", peri ) ;
}
aperi ( int r, float *a, float *p )
{
*a = 3.14 * r * r ;
*p = 2 * 3.14 * r ;
}

OUTPUT:

Enter radius of a circle 10
Area = 314.000000
Perimeter = 62.800000


0 comments to "PROGRAM FOR FUNCTION CALL BY REFERENCE IN C"

Post a Comment

Powered by Blogger.