Q:

# C program to find the Surface Area and Volume of the Cylinder

Read the radius and height of the cylinder from the user, and calculate the volume and surface area of the cylinder.

Cylinder volume formula: πr2h

Cylinder surface area formula: 2πrh+2πr2

Where, r is the radios and h is the height.

Program:

The source code to find the Surface Area and Volume of the cylinder is given below. The given program is compiled and executed using GCC compile on UBUNTU 18.04 OS successfully.

``````// C program to find the surface Area and volume
// of the cylinder

#include <stdio.h>

{
float result = 0.0F;

return result;
}

{
float result = 0.0F;

return result;
}

int main()
{
float height = 0;
float volume = 0;
float area = 0;

printf("Enter the height: ");
scanf("%f", &height);

printf("Volume of Cylinder is: %f\n", volume);
printf("Surface area of Cylinder is: %f\n", area);

return 0;
}``````

Output:

```RUN 1:
Enter the height: 2
Volume of Cylinder is: 6.280000
Surface area of Cylinder is: 18.840000

RUN 2:
Enter the height: 5.6
Volume of Cylinder is: 93.019356
Surface area of Cylinder is: 114.107597

RUN 3:
Enter the height: 10
Volume of Cylinder is: 4696.588867
Surface area of Cylinder is: 1707.361694
```

Explanation:

In the above program, we created three functions calcuateVolumeOfCylinder()calcuateAreaOfCylinder(), and main(). The calcuateVolumeOfCylinder() function is used to calculate the volume of Cylinder based on given radius and hight. The calcuateAreaOfCylinder () function is used to calculate the surface area of Cylinder.

In the main() function, we read the value of the side of Cube from the user. Then we called the calcuateVolumeOfCylinder()calcuateAreaOfCylinder() functions to calculate the volume and surface area of the Cylinder. After that, we printed the result on the console screen.