#include<stdio.h>
void func(int r, float *a, float *p )
{
*a = 3.14 * r * r ;
*p = 2 * 3.14 * r ;
}
void main( )
{
int radius ;
float area, perimeter ;
clrscr();
printf ( "nEnter radius of a circle " ) ;
scanf ( "%d", &radius ) ;
func( radius, &area, &perimeter ) ;
printf ( "Area = %f", area ) ;
printf ( "nPerimeter = %f", perimeter ) ;
}
Output
Enter radius of a circle 5
Area = 78.500000
Perimeter = 31.400000