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
using System ; public class GFG { static float CubeVolume ( float d ) { float Volume ; Volume = ( float ) ( Math . Sqrt ( 3 ) * Math . Pow ( d , 3 ) ) / 9 ; return Volume ; } public static void Main ( ) { float d = 5 ; Console . WriteLine ( " Volume ▁ of ▁ Cube : ▁ { 0 : F4 } " , CubeVolume ( d ) ) ; } }