summaryrefslogtreecommitdiff
path: root/sphererevol.c
blob: ff1bbf8a342d716b90f466f47247ff63f9cddc7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*Calculates the volume of a sphere*/
#include <math.h>
#include <stdio.h>

int main()
{
    double radius = 5;
    float pi = M_PI;
    double radiusCubed = pow(radius,3);
    float answer = (4*pi*radiusCubed/3);
    
    printf("The volume of a sphere with radius %f is %f\n",radius,answer);
    return 0;
    }