What will be the output of the following C program?
void count(int n)
{ static int d = 1;
printf("%d", n);
printf("%d", d);
d++;
if (n > 1) count (n - 1);
printf ("%d", d);
}
void main ( )
{
count (3);
}
Open in App
Solution
So output will be printed in serial order given in solution i.e, 3 1 2 2 1 3 4 4 4.