text: Chiliagon Number | C program for above approach ; Finding the nth chiliagon Number ; Driver program to test above function
code: #include <stdio.h> NEW_LINE #include <stdlib.h> NEW_LINE int chiliagonNum ( int n ) { return ( 998 * n * n - 996 * n ) / 2 ; } int main ( ) { int n = 3 ; printf ( "3rd ▁ chiliagon ▁ Number ▁ is ▁ = ▁ % d " , chiliagonNum ( n ) ) ; return 0 ; }