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.

Basic Networking Questions

This quiz consists of some basic networking questions.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

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.