# How to calculate the area and volume of a Cylinder using C

Not what you're looking for? Search our solutions OR ask your own Custom question.

Write a library Cylinder containing functions to compute the total surface area, lateral surface area, and volume of a right-circular cylinder. For a cylinder of radius r and height h, these can be calculated using:

Total Surface Area = 2 x Pi r(r + h)

Lateral Surface Area = 2 x Pi rh

Volume = Pi r squared h

Write a driver program to test your library.

Â© BrainMass Inc. brainmass.com December 24, 2021, 5:09 pm ad1c9bdddfhttps://brainmass.com/computer-science/c/calculate-area-volume-cylinder-31579

#### Solution Preview

First compile the library file

gcc -c cylinder.c

this will ...

#### Solution Summary

This solution teaches how to write a C library function that calculates the following functions for a Cylinder.

a) Total Surface Area

b) Lateral Surface Area

c) Volume

It also teaches how to compile the C library and how to use a C driver program to use the compiled C library.

Includes header file and .c program files.

$2.49