what is wrong with these c program. the program runs but does not display and calculate result #include //main function int main() { //Set constant value for PI const float PI=3.1415; //declare...


what is wrong with these c program. the program runs but does not display and calculate result



#include
//main function
int 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;
}



Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here