Computer Science, asked by pooja55273, 4 months ago

write a C program to accept dimension and display the surface atea and volume of cylinder? ​

Answers

Answered by asinsarabiga
7

Answer:

Write a c program to find the volume and surface area of cylinder

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

Answered by satputesonali42
4

Answer:

Explanation:

#include<conio.h>

#include<stdio.h>

void main()

{

float r,h,v,A; //declare variables r=radius, h=height , v=volume , A=area

float p=3.14;

//accepting radius(r) and height(h)

printf("\nEnter Value of radius:");

scanf("%f",&r);

printf("\nEnter Value of height:");

scanf("%f",&h);

A=(2*p*r*h)+(2*p*r*r); //formula of surface area of cylinder

v=p*r*r*h; //formula of volume of cylinder

printf("Surface Area of Cylinder :- %f ",A);

printf("Volume of Cylinder :- %f ",v);

}

Similar questions
Math, 10 months ago