Hey, I am new here and was wondering if someone more knowledgeable could give me a couple pointers... I think the problem has to do with the scanf() function and improper coding, but I cannot figure out what I am doing wrong.
The requirements are:
Calculate the volume of snow, in cubic feet, that it would take to build a snowman, made of 3 round snowballs.
Read the diameter of the top, middle, and bottom snowballs from the user in inches. Calculate the volume of each required snowball and the total volume and print all 4 values, with appropriate labels and exactly 1 decimal place. Use a constant to hold the number of inches in 1 foot.
/* Snowman program */
#define PI 3.141593
double x, y, z; //x= bottom diameter, y= middle diameter, z= top diameter
/*Asks for the bottom, middle, and top diameters*/
printf("Enter the value for the bottom, middle, and top diameters>");
What IDE are you using? It should give you load of warnings.
1) Send to printf actual variables, not the pointer to them (get rid of "&" before function argument)
2) Gcc gives me a warning on "%lf" in printf and working incorrectly. if you will have problems with that, change it to "%f".