Posts

Showing posts from July, 2021

Print n numbers using recursion

The following is the java method to print n numbers using recursion :- public static void print(int n) {         if (n == 0)             return;         print(n - 1);         System.out.print(n + " "); }