CProgram

Find the Sphere Surface Area and Volume of a Sphere

Write a C program to find the sphere surface area and volume of a sphere.

/*Program to find Sphere Surface Area and Volume of a Sphere
Sphere Surface Area = 4 * PI * r * r
Volume of Sphere = (4/3) * PI * r * r * r*/
#include <stdio.h>
#define PI 3.142
main()
{
float r, area, vol;
printf(“\nEnter radius of Sphere: “);
scanf(“%f”, &r);
area = 4 * PI * r * r;
vol = (4/3) * PI * r * r * r;
printf(“\nSphere Surface Area = %.2f”, area);
printf(“\nVolume of Sphere = %.2f”, vol);
getch();
}

What's your reaction?

Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0

You may also like

Leave a reply

Your email address will not be published.

More in:C