Volume of cube using its space diagonal | C ++ program to find the volume occupied by Cube with given space diagonal ; Function to calculate Volume ; Formula to find Volume ; Drivers code ; space diagonal of Cube
#include <bits/stdc++.h> NEW_LINE using namespace std ; float CubeVolume ( float d ) { float Volume ; Volume = ( sqrt ( 3 ) * pow ( d , 3 ) ) / 9 ; return Volume ; } int main ( ) { float d = 5 ; cout << " Volume ▁ of ▁ Cube : ▁ " << CubeVolume ( d ) ; return 0 ; }