2/20/2009

C Program To Find The Area Of A Circle



    /*Write a c program to accept the radius
        to find the area of a circle */
#include <stdio.h>
#include <stdlib.h>
#define pi 3.14

int main()
{
    int r ;
    float area;
    printf("Enter the radius of a circle:\n");
        scanf("%d",&r);
    area = pi *r *r ;
    printf("The area of a circle is : %.2f \n", area);
    return 0;
}
Out Put:
Enter the radius of a circle:
6
The area of a circle is : 113.04

No comments:

Post a Comment