Answer to Question #310172 in C for singh

Question #310172

Write a C program to accept dimensions of a cylinder and display the surface area and

volume of cylinder.


1
Expert's answer
2022-03-12T01:51:59-0500
#include <stdio.h>

int main() {
      float radius, height, volume, area;

    printf("Enter cylinder radius: ");
    scanf("%f", &radius);
    printf("Enter cylinder height: ");
    scanf("%f", &height);
    volume = 3.14 * (radius * radius) * height;
    area = 2 * 3.14 * radius * (radius + height);
    
    printf("\n\n");
    printf("Surface area: %.3f\n", area);
    printf("Volume of cylinder: %.3f\n", volume);    
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS