write a programm to calculate the
area and circumfurance of a given circle.
#include<stdio.h>
#define pi 3.14159
void main()
{
float r, area, circumference;
clrscr(); /* to clear the screen */
printf("Program to calculate area and
circumference ");
printf("of a circle for a given
radius.");
printf("\n\nPlease enter the radius in
centimeters : ");
scanf("%f", &r);
area = pi * r * r;
circumference = 2 * pi * r;
printf("\nThe area of the circle = %.2f
sq. cm.\n", area);
printf("\nThe circumference of the
circle = %.2f cms.\n", circumference);
printf("\nJob over...Press any key to
continue "); getch();
}
Labels: C