Program to calculate Area Of Octagon | CPP program to find area of octagon ; Utility function ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; double areaOctagon ( double side ) { return ( float ) ( 2 * ( 1 + sqrt ( 2 ) ) * side * side ) ; } int main ( ) { double side = 4 ; cout << " Area ▁ of ▁ Regular ▁ Octagon ▁ = ▁ " << areaOctagon ( side ) << endl ; return 0 ; }