Question:C program for area of a cylinder 

Answer 
#include<stdio.h>
#include<math.h>

int main(){

    float r,h;
    float surface_area,volume;

    printf("Enter size of radius and height of a cylinder : ");
    scanf("%f%f",&r,&h);

    surface_area = 2 * M_PI * r * (r + h);
    volume = M_PI * r * r * h;

    printf("Surface area of cylinder is: %.3f",surface_area);
    printf("\nVolume of cylinder is : %.3f",volume);

    return 0;
}
Sample output: Enter size of radius and height of a cylinder: 4 10 Surface area of cylinder is: 351.858 Volume of cylinder is: 502.655 

+ ExplanationNot Moderated
+ Report
Total Preview: 1021
C program for area of a cylinder
Copyright © 2024. Powered by Intellect Software Ltd