how this recursive function is working

pvicky_20's Avatar, Join Date: Nov 2011
Newbie Member
Code:
#include<stdio.h>
void fun(int);
typedef int (*pf) (int, int);
int proc(pf, int, int);

int main()
{
    int a=3;
    fun(a);
    return 0;
}
void fun(int n)
{
    if(n > 0)
    {
        fun(--n);
        printf("%d,", n);
        fun(--n);
    }
}

Last edited by shabbir; 7Nov2011 at 19:32.. Reason: Code blocks
poornaMoksha's Avatar, Join Date: Jan 2011
Ambitious contributor
What are you trying to achieve with this code?
Please be more precise with your question.
archanababu's Avatar
Banned
Output of the recursive funtion is 20
I like C & C++. So i always looking challenges in programming