Area of decagon inscribed within the circle | C # Program to find the area of the decagon inscribed within a circle ; Function to find the area of the decagon ; radius cannot be negative ; area of the decagon ; Driver code
using System ; class GFG { static double area ( double r ) { if ( r < 0 ) return - 1 ; double area = ( 5 * Math . Pow ( r , 2 ) * ( 3 - Math . Sqrt ( 5 ) ) * ( Math . Sqrt ( 5 ) + ( ( 2 * Math . Sqrt ( 5 ) ) ) ) / 4 ) ; return area ; } static public void Main ( ) { double r = 8 ; Console . WriteLine ( area ( r ) ) ; } }