Purchase Solution

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

Not what you're looking for?

Ask 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.

Purchase this Solution

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.

Solution Preview

First compile the library file
gcc -c cylinder.c
this will ...

Purchase this Solution

Free BrainMass Quizzes
C# variables and classes

This quiz contains questions about C# classes and variables.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.