Here is source code of the C Program to Find the volume and surface area of cylinder.The C program is successfully compiled and run on a Linux system. The program output is also shown below.
* C Program to Find the Volume and Surface Area of cylinder
float radius, height;
float surface_area, volume;
printf("Enter value for radius and height of a cylinder : \n");
scanf("%f%f", &radius, &height);
surface_area = 2 * (22 / 7) * radius * (radius + height);
volume = (22 / 7) * radius * radius * height;
printf("Surface area of cylinder is: %.3f", surface_area);
printf("\n Volume of cylinder is : %.3f", volume);
Output: $ cc pgm29.c -lm $ a.out Enter value for radius and height of a cylinder : 15 17 Surface area of cylinder is: 2880.000 Volume of cylinder is : 11475.000
Sanfoundry Global Education & Learning Series – 1000 C Programs.