Negative numbers

In this video if n<0 it should print negative numbers also.But,In this video negative humbers
it is not printing.

first of all in this question we are asked to print numbers from 1 to n . but in case we have our n < 0 than dec recursive function will never hit the base case that is n==0 as if we keep on decrementing n and since n is already a negetive , we will never reach 0 and we will get stuck in an infinite recursive call . so the case of n<0 will not work in our solution

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.