Write a function that calculates both Area and Perimeter/ Circumference of the Circle, whose Radius is entered through the keyboard.

#include<stdio.h>
main()
{

int radius;
float area, perimeter;

printf("\nEnter radius of a circle:");

scanf ("%d", &radius);
areaperi (radius, &area, &perimeter);

printf("Area=%f", area);
printf("\nPerimeter=%f", perimeter);

}


areaperi(int r, float *a, float *p)

{
*a=3.14*r*r;
*p=2*3.14*r;

}



//This Program exhibits the use of Call By Reference.




The program can be found at:
Download File.

No comments:

Post a Comment

kiss on google ads if you are anonymous because your ip is trackable.thank you.

......from.admin