Hendecagonal number | Java program to find nth Hendecagonal number ; Function to find Hendecagonal number ; Formula to calculate nth Hendecagonal number ; Driver Code
import java . io . * ; class GFG { static int hendecagonal_num ( int n ) { return ( 9 * n * n - 7 * n ) / 2 ; } public static void main ( String [ ] args ) { int n = 3 ; System . out . print ( n + " rd ▁ Hendecagonal ▁ " + " number : ▁ " ) ; System . out . println ( hendecagonal_num ( n ) ) ; n = 10 ; System . out . print ( n + " th ▁ Hendecagonal ▁ " + " number : ▁ " ) ; System . out . println ( hendecagonal_num ( n ) ) ; } }