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