This is my code, basically i'm trying to write a program which find s the volume of spheres with certain radius's. However it doesn't seem to be working, and is returning values of 0. Any clue as to why? Any help would be much appreciated
Code:
#include <stdio.h>
#define Pi 3.14159265
double VolumeForRadius(double Radius)
{
double radius;
double volume = (4.0 / 3.0) * Pi * radius * radius * radius;
return volume;
}
int main(int argc, char *argv[])
{
printf("The volume of a sphere with radius %d is %f\n", 1, VolumeForRadius(1.0));
printf("The volume of a sphere with radius %f is %f\n", 4.657, VolumeForRadius(4.657));
printf("The volume of a sphere with radius %d is %f\n", 10, VolumeForRadius(10));
printf("The volume of a sphere with radius %d is %f\n", 42, VolumeForRadius(42));
}