Pages

Wednesday, November 30, 2011

C Programming to find area and circumference of a circle

/*to find area and circumference of a circle*/
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
    float r,a,c;
    printf("Enter radius of a circle: ");
    scanf("%f",&r);
    a=M_PI*r*r;
    c=M_PI*2*r;
    printf("The area of the circle=%f",a);
    printf("\n the circumference of the circle=%f",c);
    system("pause");
    return 0;
}

No comments:

Post a Comment