In this article we will show you, How to write C Program to find Volume and Surface area of Sphere with example. Before we step into the program, Let see the definitions and formulas behind Surface area of Sphere and Volume of Sphere

### Surface Area of Sphere

A Sphere looks like a basketball or we can say the three-dimensional view of a circle. If we know the radius of the Sphere then we can calculate the Surface Area of Sphere using formula:

- Surface Area of a Sphere = 4πr² (Where r is radius of the sphere).

From the above formula, If we know the Surface Area of a sphere then we can calculate the radius of a Sphere using the formula:

- Radius of a Sphere = √sa / 4π (Where sa is the Surface Area of a sphere).

### Volume of Sphere

Amount of space inside the sphere is called as Volume. If we know the radius of the Sphere then we can calculate the Volume of Sphere using formula:

- Volume of a Sphere = 4πr³

## C Program to find Volume and Surface Area of Sphere

We defined pi as global variable and assigned value as 3.14. This C program allows user to enter the value of a radius and then it will calculate the Surface Area and Volume of a Sphere as per the formula.

**CODE**

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
/* C Program to find Volume and Surface Area of Sphere */ #include <stdio.h> #define PI 3.14 int main() { float radius, sa,Volume; printf("\n Please Enter the radius of a Sphere \n"); scanf("%f", &radius); sa = 4 * PI * radius * radius; Volume = (4.0 / 3) * PI * radius * radius * radius; printf("\n The Surface area of a Sphere = %.2f", sa); printf("\n The Volume of a Sphere = %.2f", Volume); return 0; } |

**OUTPUT**

We have entered the Radius of a Sphere = 5

The **Surface Area of a Sphere** is

Surface Area = 4πr²

Surface Area = 4 * PI * radius * radius;

Surface Area = 4 * 3.14 * 5 * 5

Surface Area = 314

The **Volume of a Sphere** is

Volume = 4πr³

Volume = (4.0 / 3) * PI * radius * radius * radius;

Volume = (4.0 / 3) * 3.14 * 5 * 5 * 5;

Volume = 523.33333

Let us calculate the **Radius of a Sphere** using the Surface Area:

In the above example we got Surface area of a Sphere = 314 when the radius = 5. Let us do the reverse approach (I mean calculate the radius from Surface area = 5)

radius of a Sphere = √sa / 4π

radius of a Sphere = √314 / 4 * 3.14

radius of a Sphere = √314 / 12.56

radius of a Sphere = √25

radius of a Sphere = 5

Thank You for Visiting Our Blog

## Leave a Reply