Calculate Volume of Dodecahedron - GeeksforGeeks

17 Mar, 2021
Given the edge of the dodecahedron calculate its Volume. Volume is the amount of the space which the shapes takes up. A dodecahedron is a 3-dimensional figure made up of 12 faces, or flat sides. All of the faces are pentagons of the same size.The word ‘dodecahedron’ comes from the Greek words dodeca (‘twelve’) and hedron (‘faces’).Formula: Volume = (15 + 7√5)*e3/4Where e is length of an edge.Examples :  
Input : side = 4
Output : 490.44

Input : side = 9
Output : 5586.41
 
 
C++
Java
Python3
C#
PHP
Javascript
// CPP program to calculate// Volume of dodecahedron#include <bits/stdc++.h>using namespace std; // utility Functiondouble vol_of_dodecahedron(int side){    return (((15 + (7 * (sqrt(5)))) / 4)                       * (pow(side, 3))) ;}// Driver Functionint main(){    int side = 4;         cout << "Volume of dodecahedron = "         << vol_of_dodecahedron(side);}
// Java program to calculate// Volume of dodecahedron import java.io.*; class GFG{        // driver function    public static void main (String[] args)       {           int side = 4;           System.out.print("Volume of dodecahedron = ");           System.out.println(vol_of_dodecahedron(side));       }          static double vol_of_dodecahedron(int side)        {             return (((15 + (7 * (Math.sqrt(5)))) / 4)                       * (Math.pow(side, 3)));        }} // This code is contributed// by Azkia Anam.
# Python3 program to calculate# Volume of dodecahedronimport math # utility Functiondef vol_of_dodecahedron(side) :     return (((15 + (7 * (math.sqrt(5)))) / 4)                    * (math.pow(side, 3))) # Driver Functionside = 4print("Volume of dodecahedron =",       round(vol_of_dodecahedron(side), 2))        # This code is contributed by Smitha Dinesh Semwal
// C# program to calculate// Volume of dodecahedronusing System; public class GFG{         // utility Function    static float vol_of_dodecahedron(int side)    {        return (float)(((15 + (7 * (Math.Sqrt(5)))) / 4)                        * (Math.Pow(side, 3))) ;    }              // Driver Function    static public void Main ()    {        int side = 4;             Console.WriteLine("Volume of dodecahedron = "            + vol_of_dodecahedron(side));    }} /* This code is contributed by vt_m.*/
<?php// PHP program to calculate// Volume of dodecahedron // utility Functionfunction vol_of_dodecahedron($side){    return (((15 + (7 * (sqrt(5)))) / 4)                      * (pow($side, 3))) ;}     // Driver Function    $side = 4;    echo ("Volume of dodecahedron = ");    echo(vol_of_dodecahedron($side));     // This code is contributed by vt_m.?>
<script>// javascript program to calculate// Volume of dodecahedron  // utility Functionfunction vol_of_dodecahedron( side){    return (((15 + (7 * (Math.sqrt(5)))) / 4)                       * (Math.pow(side, 3))) ;} // Driver Function    let side = 4;    document.write("Volume of dodecahedron = " +    vol_of_dodecahedron(side).toFixed(2));         // This code contributed by gauravrajput1</script>
Output :  
 
Volume of dodecahedron = 490.44
 
vt_m
GauravRajput1
area-volume-programs
Geometric
School Programming
Geometric
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Program for distance between two points on earth
Convex Hull | Set 1 (Jarvis's Algorithm or Wrapping)
Convex Hull | Set 2 (Graham Scan)
Given n line segments, find if any two segments intersect
Closest Pair of Points | O(nlogn) Implementation
Python Dictionary
Arrays in C/C++
Inheritance in C++
Reverse a string in Java
Interfaces in Java