Taking an Online C course, and when I did this for one of the homework questions, it does not work as I intend it to. It is supposed to prompt the user to enter the radius, and then do the calculations and print out the answer. What it DOES is print out nothing, but executes fine, and when I enter a number, THEN it prints out the prompt as well as the answer.
Basically, why wont it prompt to do the input first, as it is written in the code :
int main(void)
{
float volume, radius;
printf("Enter the radius of the sphere: \n");
scanf("%f", &radius);
volume = (4.0f / 3.0f) * 3.14f * radius * radius * radius;
printf("%.2f", volume);
return 0;
}