Thursday, 21 July 2011

Program to find Sphere Surface Area and Volume of a Sphere in c

Do you like this post?
#include
#include
#define PI 3.142 \\ macro
void main()
{
float r, ara, vol;
printf("\nEnter Radius of sphere:- ");
scanf("%f", &r);
ara = 4 * PI * r * r;
vol = (4/3) * PI * r * r * r;
printf("\nSphere Surface Area = %.2f", ara);
printf("\nVolume of Sphere = %.2f", vol);
getch();
}

No comments:

Post a Comment