From 97a693d996c79fb2a008b19750d8bb45512e01a2 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 6 Feb 2017 11:26:44 -0500 Subject: Inital commit --- sphererevol.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sphererevol.c (limited to 'sphererevol.c') diff --git a/sphererevol.c b/sphererevol.c new file mode 100644 index 0000000..ff1bbf8 --- /dev/null +++ b/sphererevol.c @@ -0,0 +1,14 @@ +/*Calculates the volume of a sphere*/ +#include +#include + +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; + } -- cgit v1.2.3-70-g09d2