Monday, January 3, 2011

Program to calculate area of a circle

/*
Name: Program to calculate area of a circle
Author: Parveen Malik
Date: 03/01/11 19:46
*/

#include<stdio.h>
#include<stdio.h>
#define PI 3.141 // to define value of pi


void main()
{
int radius;
float area;

printf("Enter the radius of the Circle : ");
scanf("%d",&radius);

area=PI*radius*radius; // formula to find the area of a circle
printf("\nArea of the Circle is : %.2f",area);

getch();
}
OUTPUT:



[caption id="attachment_12" align="aligncenter" width="656" caption="OUTPUT"]Program to calculate area of a circle[/caption]



0 comments:

Post a Comment