Find the best solutions to your questions at Westonci.ca, the premier Q&A platform with a community of knowledgeable experts. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform. Our platform offers a seamless experience for finding reliable answers from a network of knowledgeable professionals.

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

We hope you found what you were looking for. Feel free to revisit us for more answers and updated information. Thanks for using our service. We're always here to provide accurate and up-to-date answers to all your queries. Find reliable answers at Westonci.ca. Visit us again for the latest updates and expert advice.