C
Programming and Technical
Category
void fn(int);
main()
{
int n=3;
fn(n);
}
void fn(int n)
{
if(n>0)
{
fn(--n);
printf("%d",n);
fn(--n);
}
}
Read Solution (Total 6)
-
- 0 1 2 0 for every function call function is put into stack and then remove.
- 10 years agoHelpfull: Yes(11) No(2)
- does not print anything ans function is called recursively 3210.when n becomes 0 if statement wont get executed
- 10 years agoHelpfull: Yes(8) No(3)
- it doesnt produce output, because fn calls itself. if n becomes 0 then if condition is not true.
- 10 years agoHelpfull: Yes(1) No(2)
- 2
0
is the output - 9 years agoHelpfull: Yes(1) No(0)
- f(3) -> f(2) -> f(1) ->f(0)
print 0 f(-1)
print 1 - 10 years agoHelpfull: Yes(0) No(1)
- ans is :0102010
- 9 years agoHelpfull: Yes(0) No(0)
C Other Question