Octadecagonal Number | C # program to find Nth octadecagonal number ; Function to find N - th octadecagonal number ; Formula to calculate nth octadecagonal number ; Driver code
using System ; class GFG { static int Octadecagonal_num ( int n ) { return ( 16 * n * n - 14 * n ) / 2 ; } public static void Main ( string [ ] args ) { int n = 3 ; Console . Write ( Octadecagonal_num ( n ) + " STRNEWLINE " ) ; n = 10 ; Console . Write ( Octadecagonal_num ( n ) + " STRNEWLINE " ) ; } }