public static void increase(int N){
int a = 1;
if(b <= N) {
System.out.print(a + " ");
a++;
} else {
increase(N);
}
}
I can see the problem with this approach that the int a gets initialized to 1 every time the code goes for a recursive call. Can anyone suggest the correct solution?