Surface Area and Volume of Hexagonal Prism | C # program to find the 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
using System ; class GFG { static void findSurfaceArea ( float a , float h ) { float Area ; Area = 6 * a * h + 3 * ( float ) ( Math . Sqrt ( 3 ) ) * a * a ; Console . WriteLine ( " Surface ▁ Area : ▁ " + Area ) ; } static void findVolume ( float a , float h ) { float Volume ; Volume = 3 * ( float ) ( Math . Sqrt ( 3 ) ) * a * a * h / 2 ; Console . WriteLine ( " Volume : ▁ " + Volume ) ; } public static void Main ( ) { float a = 5 , h = 10 ; findSurfaceArea ( a , h ) ; findVolume ( a , h ) ; } }