Program to check if N is a Decagonal Number | C # program for the above approach ; Function to check if N is a decagonal Number ; Condition to check if the number is a decagonal number ; Driver Code ; Given Number ; Function call
using System ; class GFG { static bool isdecagonal ( int N ) { double n = ( 3 + Math . Sqrt ( 16 * N + 9 ) ) / 8 ; return ( n - ( int ) n ) == 0 ; } static public void Main ( ) { int N = 10 ; if ( isdecagonal ( N ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }