Why this solution is not working ??
int dec(int n)
{
if(n==1)
{
printf("%d\n",n);
return n;
}
int a=dec(n-1);
return a;
}
Recursion to print numbers in decresing order
Hello @gunjan13082000
Your function prints something only when n == 1.
How would it print other numbers.
Here is the code
Let me know if you need any help.
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.