Program to calculate Area Of Octagon | C # Program to find area of Octagon . ; utility function ; Driver code
using System ; class GFG { static double areaOctagon ( double side ) { return ( float ) ( 2 * ( 1 + Math . Sqrt ( 2 ) ) * side * side ) ; } public static void Main ( ) { double side = 4 ; Console . WriteLine ( " Area ▁ of ▁ Regular ▁ Octagon ▁ = ▁ " + areaOctagon ( side ) ) ; } }