Okay so I've made the changes, and its compiling now
but it crashes when it gets to the 'printresults' function in main, saying that..
Code:
Run-Time Check Failure #3 - The variable 'radius' is being used without being initialized.
Heres the changes i've made so far......
Code:
/*
Title: Program to calculate the volume of two rooms
Author: Matthew Sokolowski 025 586 100 PRG 155
Date: February 21, 2010
Description: This program will use the function colume_calc()
to ask the user for l1,w1,h1 as well as l2, h2, w2
and then calculate the total volume. This information
will then be passed to the screen by a function
*/
//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(void);
void printresults(double , double , double );
int main (void)
{
double area, radius, volume;
explanation();//FUNCTION CALL
volume_calc();//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(void)
{
//VARIABLE DECLARATIONS
double radius, area, volume;
//GET USER INPUT
printf ("\n\n\nPlease entert the radius of the sphere==> ");
fflush (stdin);
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);
}