Program to calculate area and volume of a Tetrahedron | Java code to find the volume of a tetrahedron ; Function to calculate volume ; Driver Code
import java . io . * ; class Tetrahedron { static double vol_tetra ( int side ) { double volume = ( Math . pow ( side , 3 ) / ( 6 * Math . sqrt ( 2 ) ) ) ; return volume ; } public static void main ( String [ ] args ) { int side = 3 ; double vol = vol_tetra ( side ) ; vol = ( double ) Math . round ( vol * 100 ) / 100 ; System . out . println ( vol ) ; } }