Nonagonal number | Java Program to find nth nonagonal number . ; Function to find nth nonagonal number . ; Formula to find nth nonagonal number . ; Driver function .
import java . io . * ; class GFG { static int Nonagonal ( int n ) { return n * ( 7 * n - 5 ) / 2 ; } public static void main ( String args [ ] ) { int n = 10 ; System . out . println ( Nonagonal ( n ) ) ; } }