^^^
AHH! okay makes perfect sense, I corrected that and now the program compiles!!
im not getting the desired output though lol
if i enter a radius of 25, i should get a volume of 65449.847 and an area of 7853.982, instead i'm getting a volume of 9.425 and an area of 25.133 :S
is it because im not returning anything from the calc?
Code:
//INCLUDE SECTION
#include <stdio.h> //def's 4 printf, scanf, getchar, puts, gets, fflush
#include <conio.h> //def's for getch
#include <stdlib.h> //def's 4 system
#define PI 3.14159
//FUNCTION PROTOTYPES
void explanation(void);
void volume_calc(double *area, double *radius,double *volume);
void printresults(double area, double radius, double volume);
int main (void)
{
double area, radius, volume;
explanation();//FUNCTION CALL
volume_calc(&area, &radius, &volume);//FUNCTION CALL
printresults(area, radius, volume);
printf("\n\t\t\tPRESS ANY KEY TO EXIT");
_getch();
return 0;
}
//FUNCTION DEFINITIONS
void explanation(void)
{
system ("cls");
puts ("This program will ask you to enter the RADIUS of a sphere...");
puts ("and then calculate the volume and surface area...");
}
void volume_calc( double *area, double *radius, double *volume)
{
//VARIABLE DECLARATIONS
//GET USER INPUT
printf ("\n\n\nPlease entert the radius of the sphere==> ");
scanf ("%f", &*radius);
//CALCULATIONS
*volume=((4/3)*PI*(radius,3));
*area=(4*PI*(radius,2));
//OUTPUT
}
void printresults(double area,double radius,double volume)
{
printf("You entered a radius of %.3f...", radius);
printf("\nthe volume of this sphere is ==> %.3f", volume);
printf("\n\ntthe area of this sphere is ==> %.3f", area);
}