Program to check if N is a Dodecagonal Number | C # program for the above approach ; Function to check if number N is a dodecagonal number or not ; Condition to check if the N is a dodecagonal number ; Driver Code ; Given number ; Function call
using System ; class GFG { static bool isdodecagonal ( int N ) { float n = ( float ) ( ( 4 + Math . Sqrt ( 20 * N + 16 ) ) / 10 ) ; return ( n - ( int ) n ) == 0 ; } public static void Main ( string [ ] args ) { int N = 12 ; if ( isdodecagonal ( N ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }