# C Program to Calculate Volume of Sphere

In this post, we will learn how to calculate the volume of a sphere using C Programming language.

The volume of a sphere is the amount of air that a sphere can hold inside it. The formula of calculating the volume of of a sphere with radius â€˜râ€™ is given by the formula:

• Volume of Sphere = (4/3)Ï€r3

This program will use the above formula to calculate the volume of a sphere.

So, without further ado, letâ€™s begin this tutorial.Â

## C Program to Calculate Volume of Sphere

```// C Program to Calculate Volume of Sphere
#include <stdio.h>
int main(){
float volume;

printf("Enter the radius of the sphere: ");

// Calculating volume of sphere

// Displaying output
printf("Volume of Sphere: %.2f", volume);
return 0;
}
```

Output

``````Enter the radius of the sphere: 7
Volume of Sphere: 1436.03
``````

## How Does This Program Work ?

```    int radius;
float volume;
```

In this program, we have declared one int data type variable and one float data type variable.

```    // Asking for input
printf("Enter the radius of the sphere: ");
```

Then, the user is asked to enter the radius of the sphere.

```    // Calculating volume of sphere
```

We calculate the volume of the sphere using the formula,Â  V = (4/3)Ï€r3

```    // Displaying output
printf("Volume of Sphere: %.2f", volume);
```

Finally, the volume of the sphere is printed on the screen using printf() function.

## Conclusion

I hope after going through this post, you understand how to calculate the volume of a sphere using C Programming language.

If you have any doubt regarding the program, feel free to contact us in the comment section. We will be delighted to help you.