I used the concept of recursive function in the following but from my understanding of the concept, the output of the code should be 0, but the output here is 012345 and I'm not sure how it is working.
Could someone please explain it to me as my College Professor couldn't do so.
#include<stdio.h>
#include<conio.h>
int yo(int a)
{
if(a>0)
{
yo(a-1); //using recursion function
}
printf("%d",a); //printing value
}
void main()
{
yo(5);
getch();
}