Area of hexagon with given diagonal length | C ++ program to find the area of Hexagon with given diagonal ; Function to calculate area ; Formula to find area ; Main
#include <bits/stdc++.h> NEW_LINE using namespace std ; float hexagonArea ( float d ) { return ( 3 * sqrt ( 3 ) * pow ( d , 2 ) ) / 8 ; } int main ( ) { float d = 10 ; cout << " Area ▁ of ▁ hexagon : ▁ " << hexagonArea ( d ) ; return 0 ; }