Centered decagonal number | Program to find nth centered decagonal number ; Centered decagonal number function ; Formula to calculate nth centered decagonal number & return it into main function . ; Driver Code
using System ; class GFG { static int centereddecagonalnum ( int n ) { return ( 5 * n * n + 5 * n + 1 ) ; } static public void Main ( ) { int n = 5 ; Console . Write ( n + " th ▁ centered ▁ decagonal " + " number : ▁ " ) ; Console . WriteLine ( centereddecagonalnum ( n ) ) ; n = 9 ; Console . Write ( n + " th ▁ centered ▁ decagonal " + " number : ▁ " ) ; Console . WriteLine ( centereddecagonalnum ( n ) ) ; } }