2,583 views
0 votes
0 votes
#include <stdio.h>
void e(int);
int main()
{
int a = 3;
e(a);
putchar('\n');
return 0; }
void e(int n)
{
if (n > 0)
{
e(--n);
printf("%d ", n);
e(--n);
}
}

I am not getting here that when e(0) is called how is the code executed ?

1 Answer

1 votes
1 votes
when e(0) is called, if condition becomes false, and control doesn't go into if block, and simply returned from e() function.

Related questions

2 votes
2 votes
3 answers
2
Laahithyaa VS asked Sep 9, 2023
935 views
. What will be the value returned by the following function, when it is called with 11?recur (int num){if ((num / 2)! = 0 ) return (recur (num/2) *10+num%2);else return 1...
1 votes
1 votes
1 answer
4
radha gogia asked Jul 29, 2015
670 views
#include<stdio.h int main(){ int test=0; float a = 3424.34; printf("hello \n %d",(test? a: 3)); return 0; }It is giving output as hello 0 ,I am unable to understand the l...