blackshadowhawk9042 blackshadowhawk9042
  • 08-01-2021
  • Computers and Technology
contestada

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);
}
}

Respuesta :

IfeanyiEze8899 IfeanyiEze8899
  • 10-01-2021

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 Link
jesusd7457 jesusd7457
  • 07-04-2021

Answer:

to be honest I don't know

Answer Link

Otras preguntas

Which expression can be added to the right side of the equal sign to form an equation?
How do we add two irrational numbers?
y varies directly with x, and y = 2 when x = 5. What is the value of x when y = 15? A. x = 25 B. x = 10 C. x = 6 D. x = 37.5
Find the discriminant for this equation. x^2 + 3x + 1 = 0 A) 5 B) 8 C) 10 D) 25
if one leg of a right triangle measures 3 centimeters and the other leg measures 6 centimeters what is the length of the hypotenuse in the centimeters ?
A 5-pound bag of cat food costs $11.25.What is the unit price of the cat food in dollars per pound?
How many neutrons does element x have if its atomic number is 43 and it's mass number is 153?
Where was Beowulf when Grendel burst into the hall?
If you could rename the great gatsby, what would u name it and why?
You are in charge of reserving hotel rooms for a youth soccer team. Each room cost $69, plus $6 for tax, per night. You need each room for 2 nights. You need 1