Program for n | JAVA program to find the nth EVEN number ; Function to find the nth odd number ; Driver code
class GFG { static int nthEven ( int n ) { return ( 2 * n ) ; } public static void main ( String [ ] args ) { int n = 10 ; System . out . println ( nthEven ( n ) ) ; } }