Surface Area and Volume of Hexagonal Prism | Function to calculate Surface area ; Formula to calculate surface area ; Display surface area ; Function to calculate Volume ; formula to calculate Volume ; Display Volume ; Driver Code ; surface area function call ; volume function call
function findSurfaceArea ( a , h ) { let Area ; Area = 6 * a * h + 3 * Math . sqrt ( 3 ) * a * a ; document . write ( " " + Area . toFixed ( 3 ) + " " ) ; } function findVolume ( a , h ) { let Volume ; Volume = 3 * Math . sqrt ( 3 ) * a * a * h / 2 ; document . write ( " " + Volume . toFixed ( 3 ) ) ; } let a = 5 , h = 10 ; findSurfaceArea ( a , h ) ; findVolume ( a , h ) ;