Diagonal of a Regular Heptagon | C ++ Program to find the diagonal of a regular heptagon ; Function to return the diagonal of a regular heptagon ; Side cannot be negative ; Length of the diagonal ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; float heptdiagonal ( float a ) { if ( a < 0 ) return -1 ; float d = 1.802 * a ; return d ; } int main ( ) { float a = 6 ; cout << heptdiagonal ( a ) << endl ; return 0 ; }