what is wrong with these c program. the program runs but does not display and calculate result
#include//main functionint main(){ //Set constant value for PI const float PI=3.1415; //declare variables of float data type float radius; float diameter; float height; float volume=0; printf("Enter diameter of the circular base: "); scanf("%f",&diameter); printf("Enter height of the cylinder: "); scanf("%f",&height); //calculate the radius using diameter radius=diameter/2; //calculate volume volume=PI*radius*radius*height; //print volume of the cylinder printf("Volume of the cylinder: %.2f\n",volume); return 0;}
printf("Enter diameter of the circular base: "); scanf("%f",&diameter); printf("Enter height of the cylinder: "); scanf("%f",&height); //calculate the radius using diameter radius=diameter/2; //calculate volume volume=PI*radius*radius*height; //print volume of the cylinder printf("Volume of the cylinder: %.2f\n",volume);
return 0;}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here