Program to print numbers from N to 1 in reverse order | Java program to print all numbers between 1 to N in reverse order ; Recursive function to print from N to 1 ; If N is less than 1 then return static void function ; Recursive call of the function ; Driver code
class GFG { static void PrintReverseOrder ( int N ) { if ( N <= 0 ) { return ; } else { System . out . print ( N + " ▁ " ) ; PrintReverseOrder ( N - 1 ) ; } } public static void main ( String [ ] args ) { int N = 5 ; PrintReverseOrder ( N ) ; } }