Skip to content

Commit

Permalink
Should probably make radius and volume global
Browse files Browse the repository at this point in the history
  • Loading branch information
zachwill committed Sep 17, 2011
1 parent 32f4d45 commit eb11999
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions 05_02_volume_of_sphere.c
Expand Up @@ -19,6 +19,9 @@
#include <stdio.h>
#include <math.h>

int radius;
float volume;

float sphere_radius_to_volume(int radius){
float float_radius, conversion = (4.0/3.0), pi = 3.14;
float_radius = (float) radius;
Expand All @@ -30,8 +33,6 @@ int main(int argc, const char *argv[]) {
printf("You didn't include the radius of a sphere.");
return 1;
}
int radius;
float volume;
radius = atoi(argv[1]);
volume = sphere_radius_to_volume(radius);
printf("%f\n", volume);
Expand Down

0 comments on commit eb11999

Please sign in to comment.