Friday 8 February 2013

11

What is the output of the following program?

#include <stdio.h>
void e(int);

int main()
{
int a = 3;
e(a);
return 0;
}

void e(int n)
{
if (n > 0)
{
e(--n);
printf("%d ", n);
e(--n);
}
}

(a) 0 1 2 0
(b) 0 1 2 1
(c) 1 2 0 1
(d) 0 2 1 1
Join me on Facebook