edited by
6,435 views
0 votes
0 votes
#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);
}
}
edited by

Please log in or register to answer this question.

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
4 answers
2
Tariq Husain Khan asked Dec 10, 2014
1,355 views
int foo(unsigned int n) { int c,x=0; while(n!=0) { if(n&01) x++; n>>=1; } return c; }
5 votes
5 votes
2 answers
4
shekhar chauhan asked Jun 28, 2016
1,532 views
Can Someone explain either Tree or Stack method to trace out this recursion ?What is the output of this Program ?