Welcome to Westonci.ca, where finding answers to your questions is made simple by our community of experts. Join our Q&A platform to get precise answers from experts in diverse fields and enhance your understanding. Connect with a community of professionals ready to help you find accurate solutions to your questions quickly and efficiently.

What will be the output of the following code?
#include
void fun(int);
int main()
{
int a=3;
fun(a);
return 0;
}
void fun(int n)
{
if(n>0)
{
fun(--n);
printf("\n%d",n);
fun(--n);
}
}


Sagot :

Answer:

The output is 0, 1, 2, 0

Explanation:

The C source code defines a void function called 'fun'. The fun function is a recursive function that is used to recursively count through a number excluding the last number, the function accepts an integer value to be counted.

Answer:

to be honest I don't know