
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Program to calculate volume of Ellipsoid in C++
Given with r1, r2 and r3 the task is to find the volume of ellipsoid. An ellipsoid is a quadric surface, a surface that may be defined as the zero set of a polynomial of degree two in three variables. Among quadric surfaces, an ellipsoid is characterized by either of the two following properties.
Formula used to calculate volume of ellipsoid
Volume of Ellipsoid : (4/3) * pi * r1 * r2 * r3
Example
Input-: r1 = 6.3, r2 = 43.4, r3 = 3.7 Output-: volume of ellipsoid is : 4224.87
Algorithm
Start Step 1 -> define macro as #define pi 3.14 Step 2 -> Declare function to calculate Volume of ellipsoid float volume(float r1, float r2, float r3) return 1.33 * pi * r1 * r2 * r3 Step 3 -> In main() Declare variable as float r1 = 6.3, r2 = 43.4, r3 = 3.7 Volume(r1, r2, r3) Stop
Example
#include <bits/stdc++.h> #define pi 3.14 using namespace std; // Function to find the volume of ellipsoid float volume(float r1, float r2, float r3){ return 1.33 * pi * r1 * r2 * r3; } int main(){ float r1 = 6.3, r2 = 43.4, r3 = 3.7; cout << "volume of ellipsoid is : " << volume(r1, r2, r3); return 0; }
Output
volume of ellipsoid is : 4224.87
- Related Questions & Answers
- Program to calculate area and volume of a Tetrahedron
- Program for volume of Pyramid in C++
- How to calculate the volume of a sphere using C programming language?
- C++ program to create boxes and calculate volume and check using less than operator
- Program to find the Area and Volume of Icosahedron in C++
- Program for Volume and Surface Area of Cube in C++
- Program for Volume and Surface Area of Cuboid in C++
- Program to calculate value of nCr in C++
- C program to find amount of volume passed through a tunnel
- Program to calculate the value of nPr in C Program
- C program to calculate age
- Program for Volume and Surface area of Frustum of Cone in C++
- C++ Program to Calculate Sum of Natural Numbers
- C++ Program to Calculate Power of a Number
- C program to calculate the value of nPr?
Advertisements