
- C++ Basics
- C++ Home
- C++ Overview
- C++ Environment Setup
- C++ Basic Syntax
- C++ Comments
- C++ Data Types
- C++ Variable Types
- C++ Variable Scope
- C++ Constants/Literals
- C++ Modifier Types
- C++ Storage Classes
- C++ Operators
- C++ Loop Types
- C++ Decision Making
- C++ Functions
- C++ Numbers
- C++ Arrays
- C++ Strings
- C++ Pointers
- C++ References
- C++ Date & Time
- C++ Basic Input/Output
- C++ Data Structures
- C++ Object Oriented
- C++ Classes & Objects
- C++ Inheritance
- C++ Overloading
- C++ Polymorphism
- C++ Abstraction
- C++ Encapsulation
- C++ Interfaces
Program for Volume and Surface area of Frustum of Cone in C++
What is Frustrum of cone?
Frustum of a cone is formed by cutting the tip of a cone leaving lower and upper base known as frustum as shown in the figure. The upper base of frustum will have radius ‘r’, lower base will have radius ‘R’ with height ‘h’ and slant height ‘L’
Given below is the figure of Frustrum of cone
Problem
Given with slant height, height, upper base radius ‘r’ and lower radius ‘R’, the task is to calculate the volume and surface area of Frustum of cone.
To calculate the volume and surface area of Frustum of cone there is a formula
Volume (V) = 1/3 * pi * h(r2 + R2 + r*R) Curved Surface Area (CSA) = pi * l(R + r) Total Surface Area (TSA) = pi * l(R + r) + pi(R2 + r2)
Example
Input-: r=4 R=9 h=12 L=13 Output-: Volume Of Cone : 1671.33 Curved Surface Area Of Cone : 530.929 Total Surface Area Of Cone : 835.663
Algorithm
Start Step 1 -> define macro as #define pi 3.14 Step 2 -> Declare function to calculate Volume of cone float volume(float r, float R, float h) return (float(1) / float(3)) * pi * h * (r * r + R * R + r * R) Step 3 -> Declare function to calculate Curved Surface area of cone float CSA(float r, float R, float l) return pi * l * (R + r) Step 4 -> Declare function to calculate Total Surface area of cone float TSA(float r, float R, float l, float h) return pi * l * (R + r) + pi * (r * r + R * R) step 5 -> In main() declare variables as R1=4, R2=9, slantHeight=13 and height=12 call volume(R1, R2, height) Call CSA(R1, R2, slantHeight) TSA(R1, R2,slantHeight, height) Stop
Example
#include <iostream> #define pi 3.14159 using namespace std; // Function to calculate Volume of cone float volume(float r, float R, float h){ return (float(1) / float(3)) * pi * h * (r * r + R * R + r * R); } // Function to calculate Curved Surface area of cone float CSA(float r, float R, float l){ return pi * l * (R + r); } // Function to calculate Total Surface area of cone float TSA(float r, float R, float l, float h){ return pi * l * (R + r) + pi * (r * r + R * R); } int main(){ float R1 = 4; float R2 = 9; float slantHeight = 13; float height = 12; cout << "Volume Of Cone : "<< volume(R1, R2, height)<< endl; cout << "Curved Surface Area Of Cone : "<<CSA(R1, R2, slantHeight)<< endl; cout << "Total Surface Area Of Cone : "<<TSA(R1, R2,slantHeight, height); return 0; }
Output
Volume Of Cone : 1671.33 Curved Surface Area Of Cone : 530.929 Total Surface Area Of Cone : 835.663
- Related Articles
- Write the formula for the curved surface area and total surface area of the frustum of a cone.
- Program for Volume and Surface Area of Cube in C++
- Program for Volume and Surface Area of Cuboid in C++
- Python Program to calculate the volume and area of Cone
- Haskell Program to calculate the volume and area of Cone
- Derive the formula for the curved surface area and total surface area of the frustum of a cone, given to you in Section 13.5, using the symbols as explained.
- Golang program to calculate the volume and area of a Cone
- Java Program to Find the Surface area and Volume of Cuboid
- Swift Program to Find the Surface area and Volume of Cuboid
- Haskell Program to Find the Surface area and Volume of Cuboid
- Kotlin Program to Find the Surface Area and Volume of Cuboid
- The radii of the circular bases of a frustum of a right circular cone are \( 12 \mathrm{~cm} \) and \( 3 \mathrm{~cm} \) and the height is \( 12 \mathrm{~cm} \). Find the total surface area and the volume of the frustum.
- Surface Area and Volume of Hexagonal Prism in C programming
- A frustum of a right circular cone has a diameter of base \( 20 \mathrm{~cm} \), of top \( 12 \mathrm{~cm} \), and height \( 3 \mathrm{~cm} \). Find the area of its whole surface and volume.
- The perimeters of the ends of a frustum of a right circular cone are \( 44 \mathrm{~cm} \) and \( 33 \mathrm{~cm} \). If the height of the frustum be \( 16 \mathrm{~cm} \), find its volume, the slant surface and the total surface.

Advertisements