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

Number 1 and 2 please (25 points)
which of the following is the equation of a line that passes through the points (2,5) and (4,3)?
12 meters in 28 seconds?
What is the difference between our solar system, our galaxy, and the universe?
The bus company charges $2.95 per mile for each bus. What is the cost for all 6 buses to drive 124 mile trip?
The images represent sexual and asexual reproduction. The offspring in ages A and C are identical to the parents while the offspring produced in images A and D
According to Newton’s first law of motion, when will an object at rest begin to move?
two parallel wires have a current of 22A flowing through each oneof them. when the wires are placed 25cm apart, the exert a force of2.7x10-4N on each other. fin
During the Great Migration, thousands of African Americans looking for economic opportunities moved from A) west to east. B) north to west. C) west to south.
The shape of a quadratic function is called a U-shaped graph called a